IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 28, 2005, 7:04:10 AM (21 years ago)
Author:
eugene
Message:

cleanup memory leaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/choose_psf_model.c

    r4630 r4642  
    3434        modelName = psMetadataLookupPtr (&status, config, key);
    3535        tests->data[i] = pmPSF_TestModel (stars, modelName, RADIUS);
     36        psFree (modelName);
    3637
    37         sprintf (filename, "metric.%d.dat", i);
    38         DumpPSFTestData (tests->data[i], filename);
     38        // make this an option:
     39        // sprintf (filename, "metric.%d.dat", i);
     40        // DumpPSFTestData (tests->data[i], filename);
    3941    }
     42    psFree (stars);
    4043
    4144    // select the best of the test models
     
    4649    for (int i = 1; i < Ntest; i++) {
    4750        test = tests->data[i];
    48         int M = test->dApResid;
     51        float M = test->dApResid;
    4952        if (M < bestM) {
    5053            bestM = M;
     
    5558    modelName = psModelGetType (test->modelType);
    5659    psLogMsg ("psphot.pspsf", 3, "selected psf model %s, ApResid: %f +/- %f\n", modelName, test->ApResid, test->dApResid);
     60    psFree (modelName);
    5761
     62    // we are keeping the modelPSF fits from the PSF test,
     63    // but we replace these later on (apply_psf_model)
    5864    // set source->model based on best psf model fit
    5965    for (int i = 0; i < test->sources->n; i++) {
     
    6773        }
    6874    }
    69     return (test->psf);
     75    pmPSF *psf = test->psf;
     76
     77    // free unused test models:
     78    psFree (test);
     79    psFree (stars);
     80
     81    return (psf);
    7082}
Note: See TracChangeset for help on using the changeset viewer.