Changeset 13811

Show
Ignore:
Timestamp:
02/17/08 15:47:16 (5 months ago)
Author:
rouault
Message:

GFF : close file pointer in dataset destructor

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/frmts/gff/gff_dataset.cpp

    r12779 r13811  
    6969    long nOffsetMantissa; 
    7070public: 
     71    GFFDataset(); 
     72    ~GFFDataset(); 
     73 
    7174    static GDALDataset *Open( GDALOpenInfo * ); 
    7275    static int Identify( GDALOpenInfo * poOpenInfo ); 
    7376}; 
     77 
     78GFFDataset::GFFDataset() 
     79{ 
     80    fp = NULL; 
     81} 
     82 
     83GFFDataset::~GFFDataset() 
     84{ 
     85    if (fp != NULL) 
     86        VSIFClose(fp); 
     87} 
    7488 
    7589/********************************************************************* 
     
    190204    VSIFSeek(poDS->fp,56,SEEK_SET); 
    191205 
    192     VSIFRead(&poDS->nBPP,4,1,poDS->fp); 
     206    /* By looking at the Matlab code, one should write something like the following test */ 
     207    /* but the results don't seem to be the ones really expected */ 
     208    /*if ((poDS->nVersionMajor == 1 && poDS->nVersionMinor > 7) || (poDS->nVersionMajor > 1)) 
     209    { 
     210        float fBPP; 
     211        VSIFRead(&fBPP,4,1,poDS->fp); 
     212        poDS->nBPP = fBPP; 
     213    } 
     214    else*/ 
     215    { 
     216        VSIFRead(&poDS->nBPP,4,1,poDS->fp); 
     217    } 
    193218    VSIFRead(&poDS->nFrameCnt,4,1,poDS->fp); 
    194219    VSIFRead(&poDS->nImageType,4,1,poDS->fp);