/* For this, we merely clean up all the nonpermanent memory pools. Note that temp files (virtual arrays) are not allowed to belong to the permanent pool, so we will be able to close all temp files here. Closing a data source or destination, if necessary, is the application's responsibility.  */
jpeg_abort(j_common_ptr cinfo)
/* For this, we merely clean up all the nonpermanent memory pools. Note that temp files (virtual arrays) are not allowed to belong to the permanent pool, so we will be able to close all temp files here. Closing a data source or destination, if necessary, is the application's responsibility.  */
jpeg_abort(j_common_ptr cinfo)
{
    int pool;
    if (cinfo->mem == NULL)
        return;
    for (pool = JPOOL_NUMPOOLS - 1; pool > JPOOL_PERMANENT; pool--) {
        (*cinfo->mem->free_pool) (cinfo, pool);
    }
    if (cinfo->is_decompressor) {
        cinfo->global_state = DSTATE_START;
        ((j_decompress_ptr)cinfo)->marker_list = NULL;
    }
    else {
        cinfo->global_state = CSTATE_START;
    }
}