Index: /trunk/psphot/src/psphotFullForce.SourceStats.c
===================================================================
--- /trunk/psphot/src/psphotFullForce.SourceStats.c	(revision 38680)
+++ /trunk/psphot/src/psphotFullForce.SourceStats.c	(revision 38681)
@@ -106,4 +106,10 @@
             psFree(detections->newSources);
             return false;
+        }
+
+        int error = psErrorCodeLast();
+        if (error) {
+            psLogMsg ("psphot", PS_LOG_WARN, "Clearing error %d that psphotSetMomentsWindow left on the error stack.", error);
+            psErrorClear();
         }
     }
