IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 10, 2009, 11:46:34 AM (17 years ago)
Author:
bills
Message:

enable -replace and -remove options. Plug memory leaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/magic/remove/src/streaksremove.c

    r21156 r21441  
    11#include "streaksremove.h"
     2
     3#include "nebclient.h"
    24
    35static pmConfig *parseArguments(int argc, char **argv);
     
    162164            }
    163165            psArrayElementsFree (pixels);
     166            psFree(pixels);
    164167        }
    165168
    166169        if (sfiles->stage == IPP_STAGE_CHIP) {
    167         // if (CHIP_LEVEL_INPUT(sfiles->stage)) {
    168170            updateAstrometry(sfiles);
    169171        }
     
    174176        printf("time to process component %d: %f\n", sfiles->extnum, psTimerClear("PROCESS_COMPONENT"));
    175177    } while (streakFilesNextExtension(sfiles));
     178
     179    psFree(streaks);
    176180
    177181    printf("pixels: %ld streak pixels: %ld %4.2f%%\n", totalPixels, totalStreakPixels, 100. * totalStreakPixels / totalPixels);
     
    191195    }
    192196
    193 #ifdef NOTYET
    194197    if (psMetadataLookupBool(&status, config->arguments, "REPLACE")) {
    195198        //     swap the instances for the input and output
     
    221224        }
    222225    }
    223 #endif  // REPLACE, REMOVE
     226
    224227    printf("time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE"));
    225228
    226     // nebServerFree(ourNebServer);
     229    psFree(sfiles);
    227230    psFree(config);
    228231    pmConceptsDone();
     232    pmModelClassCleanup();
     233    streaksNebulousCleanup();
    229234    pmConfigDone();
    230235    psLibFinalize();
    231236
    232     //  PAU
    233237    fprintf(stderr, "Found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "streaksremove");
    234 
    235238
    236239    return 0;
     
    417420        psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "directory for temporary files",
    418421            dir);
     422        psFree(dir);
    419423        psArgumentRemove(argnum, &argc, argv);
    420424    } else {
     
    428432        psMetadataAddStr(config->arguments, PS_LIST_TAIL, "RECOVERY", 0, "directory for recovery files",
    429433            dir);
     434        psFree(dir);
    430435        psArgumentRemove(argnum, &argc, argv);
    431436    } else if ((stage == IPP_STAGE_RAW) && gotReplace) {
Note: See TracChangeset for help on using the changeset viewer.