IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32251


Ignore:
Timestamp:
Aug 31, 2011, 1:28:42 PM (15 years ago)
Author:
bills
Message:

add psFitsTableNew.h to pslib.h Fix a memory leak.

Location:
trunk/psLib/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/fits/psFitsTableNew.c

    r32229 r32251  
    9494}
    9595
    96 void breakhere()
    97 {
    98 }
    99 
    10096void
    10197freeTable(psFitsTable *table) {
     
    10399        psFitsTableColumn *column = &table->columns[col];
    104100        psFree(column->name);
     101        if (column->type == PS_DATA_STRING) {
     102            for (int row; row < table->numRows; row++) {
     103                psFree(column->data.str);
     104            }
     105        } else if (column->type == PS_DATA_VECTOR) {
     106            for (int row; row < table->numRows; row++) {
     107                psFree(column->data.vec);
     108            }
     109        }
    105110        // all of the members in the data union are pointers so just pick S32
    106111        psFree(column->data.S32);
     
    192197                    NATIVETYPE *values = (NATIVETYPE *) psAlloc(sizeof(NATIVETYPE) * table->numRows); \
    193198                    int anynul = 0; \
    194                     breakhere(); \
    195199                    fits_read_col(fits->fd, FITSTYPE, col, 1, \
    196200                                  1, numRows, NULL, values, &anynul, &status); \
     
    200204                    psTrace("psLib.fits",5,"Column #%i, '%s', is type %i, repeat %li\n", \
    201205                            col, name, typecode, repeat); \
     206                    psFree(values); \
    202207                } else { \
    203208                    column->elementSize = repeat; \
  • trunk/psLib/src/pslib_strict.h

    r27303 r32251  
    4141#include "psFitsImage.h"
    4242#include "psFitsTable.h"
     43#include "psFitsTableNew.h"
    4344#include "psFitsFloat.h"
    4445#include "psFitsFloatFile.h"
Note: See TracChangeset for help on using the changeset viewer.