Changeset 13841

Show
Ignore:
Timestamp:
02/22/08 17:36:13 (5 months ago)
Author:
warmerdam
Message:

cleanup memory leaks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spike/grib/degrib18/g2clib-1.0.4/g2_addfield.c

    r13834 r13841  
    99void specpack(g2float *,g2int,g2int,g2int,g2int,g2int *,unsigned char *, 
    1010              g2int *); 
     11void jpcpack(g2float *,g2int,g2int,g2int *,unsigned char *,g2int *); 
    1112#ifdef USE_PNG 
    1213  void pngpack(g2float *,g2int,g2int,g2int *,unsigned char *,g2int *); 
    1314#endif  /* USE_PNG */ 
    14 #ifdef USE_JPEG2000 
    15   void jpcpack(g2float *,g2int,g2int,g2int *,unsigned char *,g2int *); 
    16 #endif  /* USE_JPEG2000 */ 
     15 
    1716 
    1817 
     
    340339        } 
    341340      } 
    342 #ifdef USE_JPEG2000 
    343341      else if (idrsnum == 40 || idrsnum == 40000) {    /*  JPEG2000 encoding  */ 
    344342        if (ibmap == 255) { 
     
    365363        jpcpack(pfld,width,height,idrstmpl,cpack,&lcpack); 
    366364      } 
    367 #endif  /* USE_JPEG2000 */ 
    368365#ifdef USE_PNG 
    369366      else if (idrsnum == 41 || idrsnum == 40010) {      /*  PNG encoding   */ 
  • spike/grib/degrib18/g2clib-1.0.4/g2_getfld.c

    r13834 r13841  
    396396            lgfld->interp_opt=igds[3]; 
    397397            lgfld->igdtnum=igds[4]; 
     398            free( igds ); 
    398399          } 
    399400          else { 
  • spike/grib/gribdataset.cpp

    r13834 r13841  
    118118    nBlockXSize = poDS->nRasterXSize; 
    119119    nBlockYSize = 1; 
    120  
    121     // printf("Band %d: %s\n", nBand, GetDescription()); 
    122     //printf("size x=%d,y=%d pixels\n", poDS->nRasterXSize, poDS->nRasterYSize); 
    123     //if (m_meta->gridAttrib.f_maxmin) 
    124     //  printf("Min = %f\nMax = %f\n", m_meta->gridAttrib.min, m_meta->gridAttrib.max); 
    125     //if (m_meta->gridAttrib.f_miss) 
    126     //{ 
    127     //  printf("Missing data value = %f\n", m_meta->gridAttrib.missPri); 
    128     //  if (m_meta->gridAttrib.f_miss > 1) 
    129     //          printf("Secondary missing data value = %f\n", m_meta->gridAttrib.missSec); 
    130     //} 
    131     //printf("Content: %s\n", m_meta->longFstLevel); 
    132  
    133     //if (m_meta->gds.numPts != poDS->nRasterYSize * poDS->nRasterXSize) 
    134     //  printf("ERROR: numPts != Nx * Ny? (%ld != %ld * %ld)\n", m_meta->gds.numPts, poDS->nRasterXSize, poDS->nRasterYSize); 
    135     //else if ((m_meta->gds.Dx <= 0) || (m_meta->gds.Dy <= 0)) 
    136     //  printf("Projection code requires Dx (%f) > 0 and Dy (%f) > 0\n", m_meta->gds.Dx, m_meta->gds.Dy); 
    137120} 
    138121 
     
    224207        free (m_Grib_Data); 
    225208    if (m_Grib_MetaData) 
    226         free(m_Grib_MetaData); 
     209    { 
     210        MetaFree( m_Grib_MetaData ); 
     211        delete m_Grib_MetaData; 
     212    } 
    227213} 
    228214 
     
    468454 
    469455    OGRSpatialReference oLL; // construct the "geographic" part of oSRS 
    470     char *pszLL; 
    471     (oSRS.GetAttrNode("GEOGCS"))->exportToWkt(&pszLL); 
    472     oLL.importFromWkt(&pszLL); // set ellipsoid only (latlon system) 
    473     // delete pszLL; 
     456    oLL.CopyGeogCSFrom( &oSRS ); 
    474457 
    475458    double rMinX; 
     
    506489    adfGeoTransform[5] = -rPixelSizeY; 
    507490 
     491    CPLFree( pszProjection ); 
     492    pszProjection = NULL; 
    508493    oSRS.exportToWkt( &(pszProjection) ); 
    509494}