#include "ppbgrestore.h"

void ppbgrestoreCleanup(pmConfig *config, ppbgrestoreOptions *options)
{
    // Free memory used by ppbgrestore
    psFree(options);
    psFree(config);

    // Free memory used by psModules
    pmSourceFitSetDone ();
    pmConceptsDone();
    pmConfigDone();
    pmModelClassCleanup();

    // Free memory used by psLib
    psLibFinalize();

    // psMemBlock **memblocks;
    // int Nleaks = psMemCheckLeaks (0, &memblocks, stderr, false);
    // fprintf (stderr, "Found %d leaks at %s\n", Nleaks, "ppImage");

    // fprintf(stderr, "Found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "ppImage");

//    fprintf(stderr, "Found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "ppbgrestore");

}
