IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 23, 2004, 1:00:17 PM (22 years ago)
Author:
desonia
Message:

Changed the means of deallocation of memory. ps_Alloc now registers an optional free function to handle any additional processing of a memory object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImageIO.c

    r997 r1073  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-06-11 03:45:07 $
     9 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-06-23 23:00:15 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1919#include "psImageIO.h"
    2020#include "psError.h"
     21#include "psMemory.h"
    2122
    2223psImage* psImageReadSection(psImage* output, int col, int row, int numCols,
     
    3940    if (filename == NULL) {
    4041        psError(__func__,"Must specify filename; it can not be NULL.");
    41         psImageFree(output);
     42        psFree(output);
    4243        return NULL;
    4344    }
     
    4950        psError(__func__,"Could not open file '%s'. (%s)",
    5051                filename, fitsErr);
    51         psImageFree(output);
     52        psFree(output);
    5253        return NULL;
    5354    }
     
    6162            psError(__func__,"Could not index to '%s' HDU for file %s. (%s)",
    6263                    extname, filename, fitsErr);
    63             psImageFree(output);
     64            psFree(output);
    6465            return NULL;
    6566        }
     
    7172            psError(__func__,"Could not index to HDU #%d for file %s. (%s)",
    7273                    extnum, filename, fitsErr);
    73             psImageFree(output);
     74            psFree(output);
    7475            return NULL;
    7576        }
     
    8384        psError("Could not determine image data type of '%s'. (%s)",
    8485                filename, fitsErr);
    85         psImageFree(output);
     86        psFree(output);
    8687        return NULL;
    8788    }
     
    9495        psError("Could not determine dimensions of '%s'. (%s)",
    9596                filename,fitsErr);
    96         psImageFree(output);
     97        psFree(output);
    9798        return NULL;
    9899    }
     
    104105        psError("Dimensions of '%s' are not supported (NAXIS=%i).",
    105106                filename, nAxis);
    106         psImageFree(output);
     107        psFree(output);
    107108        return NULL;
    108109    }
     
    115116        psError("Could not determine image size of '%s'. (%s)",
    116117                filename,fitsErr);
    117         psImageFree(output);
     118        psFree(output);
    118119        return NULL;
    119120    }
     
    181182        psError(__func__,"Unsupported bitpix value (%d) in FITS file %s.",
    182183                bitPix,filename);
    183         psImageFree(output);
     184        psFree(output);
    184185        return NULL;
    185186    }
     
    187188    if (fits_read_subset(fptr, fitsDatatype, firstPixel, lastPixel, increment,
    188189                         NULL, output->data.V[0], &anynull, &status) != 0) {
    189         psImageFree(output);
     190        psFree(output);
    190191        (void)fits_get_errstatus(status, fitsErr);
    191192        status = 0;
Note: See TracChangeset for help on using the changeset viewer.