325N/A * reserved comment block 325N/A * DO NOT REMOVE OR ALTER! 325N/A * Copyright (C) 1994-1997, Thomas G. Lane. 325N/A * This file is part of the Independent JPEG Group's software. 325N/A * For conditions of distribution and use, see the accompanying README file. 325N/A * This file contains application interface routines that are used for both 325N/A * compression and decompression. 325N/A * Abort processing of a JPEG compression or decompression operation, 325N/A * but don't destroy the object itself. 325N/A * For this, we merely clean up all the nonpermanent memory pools. 325N/A * Note that temp files (virtual arrays) are not allowed to belong to 325N/A * the permanent pool, so we will be able to close all temp files here. 325N/A * Closing a data source or destination, if necessary, is the application's 325N/A /* Do nothing if called on a not-initialized or destroyed JPEG object. */ 325N/A /* Releasing pools in reverse order might help avoid fragmentation 325N/A * with some (brain-damaged) malloc libraries. 325N/A /* Reset overall state for possible reuse of object */ /* Try to keep application from accessing now-deleted marker list. * A bit kludgy to do it here, but this is the most central place. * Destruction of a JPEG object. * Everything gets deallocated except the master jpeg_compress_struct itself * and the error manager struct. Both of these are supplied by the application * and must be freed, if necessary, by the application. (Often they are on * the stack and so don't need to be freed anyway.) * Closing a data source or destination, if necessary, is the application's /* We need only tell the memory manager to release everything. */ /* NB: mem pointer is NULL if memory mgr failed to initialize. */ cinfo->
mem =
NULL;
/* be safe if jpeg_destroy is called twice */ * Convenience routines for allocating quantization and Huffman tables. * (Would jutils.c be a more reasonable place to put these?)