Index: branches/eam_branches/ipp-20101205/ppStack/src/ppStackCleanup.c
===================================================================
--- branches/eam_branches/ipp-20101205/ppStack/src/ppStackCleanup.c	(revision 30011)
+++ branches/eam_branches/ipp-20101205/ppStack/src/ppStackCleanup.c	(revision 30012)
@@ -11,5 +11,6 @@
 #include "ppStackLoop.h"
 
-
+// XXX poor name : move jpeg & stats to a separate function?
+// ppStackCleanupFiles 
 bool ppStackCleanup(ppStackThreadData *stack, ppStackOptions *options, pmConfig *config)
 {
@@ -20,15 +21,4 @@
     psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe
     psAssert(recipe, "We've thrown an error on this before.");
-
-#if 0
-    // Ensure masked regions really look masked
-    {
-        psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits for bad
-        psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
-        if (!pmReadoutMaskApply(options->outRO, maskBad)) {
-            psWarning("Unable to apply mask");
-        }
-    }
-#endif
 
     // Generate binned JPEGs
@@ -92,4 +82,5 @@
         options->expRO = NULL;
 
+	// XXX move these close / free operations to the jpeg creation function
         pmFPAview *view = pmFPAviewAlloc(0);// Pointer into FPA hierarchy
         view->chip = view->cell = 0;        // pmFPAviewFreeData doesn't want to deal with readouts
