Index: trunk/psphot/src/psphotSignificanceImage.c
===================================================================
--- trunk/psphot/src/psphotSignificanceImage.c	(revision 20463)
+++ trunk/psphot/src/psphotSignificanceImage.c	(revision 20829)
@@ -12,5 +12,5 @@
     // smooth the image and weight map
     psTimerStart ("psphot.smooth");
-    psImageConvolveSetThreads(true);
+    bool oldThreads = psImageConvolveSetThreads(true); // Old value of threading in psImageConvolve
 
     // XXX we can a) choose fft to convolve if needed and b) multithread fftw
@@ -128,9 +128,12 @@
 
     psFree(smooth_wt);
+
+    psImageConvolveSetThreads(oldThreads);
+
     return smooth_im;
 }
 
-# if (0) 
-{ 
+# if (0)
+{
     // threadingdemo
     // smooth the image, applying the mask as we go
