ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

void TIFFCleanup ( TIFF tif)

Auxiliary function to free the TIFF structure. Given structure will be completetly freed, so you should save opened file handle and pointer to the close procedure in external variables before calling _TIFFCleanup(), if you will need these ones to close the file.

Parameters:
tifA TIFF pointer.

Definition at line 46 of file tif_close.c.

Referenced by TIFFClientOpen(), and TIFFClose().

{
    if (tif->tif_mode != O_RDONLY)
        /*
         * Flush buffered data and directory (if dirty).
         */
        TIFFFlush(tif);
    (*tif->tif_cleanup)(tif);
    TIFFFreeDirectory(tif);

    if (tif->tif_dirlist)
        _TIFFfree(tif->tif_dirlist);

    /* Clean up client info links */
    while( tif->tif_clientinfo )
    {
        TIFFClientInfoLink *link = tif->tif_clientinfo;

        tif->tif_clientinfo = link->next;
        _TIFFfree( link->name );
        _TIFFfree( link );
    }

    if (tif->tif_rawdata && (tif->tif_flags&TIFF_MYBUFFER))
        _TIFFfree(tif->tif_rawdata);
    if (isMapped(tif))
        TIFFUnmapFileContents(tif, tif->tif_base, tif->tif_size);

    /* Clean up custom fields */
    if (tif->tif_nfields > 0)
    {
        size_t  i;

        for (i = 0; i < tif->tif_nfields; i++) 
        {
        TIFFFieldInfo *fld = tif->tif_fieldinfo[i];
        if (fld->field_bit == FIELD_CUSTOM && 
            strncmp("Tag ", fld->field_name, 4) == 0) 
        {
            _TIFFfree(fld->field_name);
            _TIFFfree(fld);
        }
        }   
      
        _TIFFfree(tif->tif_fieldinfo);
    }

    _TIFFfree(tif);
}

Generated on Sun May 27 2012 04:49:33 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.