--- a/src/hugin1/hugin/OptimizePanel.cpp
+++ b/src/hugin1/hugin/OptimizePanel.cpp
@@ -36,6 +36,7 @@
 #include "hugin/CommandHistory.h"
 #include "hugin/MainFrame.h"
 #include "base_wx/MyProgressDialog.h"
+#include "base_wx/PTWXDlg.h"
 #include "hugin/config_defaults.h"
 
 using namespace std;
@@ -551,6 +552,7 @@
         optPano.setCtrlPoints(newCP);
 
         // temporarily disable PT progress dialog..
+        deregisterPTWXDlgFcn();
         {
             wxBusyCursor bc;
             // run pairwise optimizer
@@ -562,6 +564,7 @@
         optPano.printPanoramaScript(std::cerr, optPano.getOptimizeVector(), optPano.getOptions(), allImg, false);
 #endif
 
+        registerPTWXDlgFcn(MainFrame::Get());
         // do global optimisation
         optPano.setCtrlPoints(cps);
         PTools::optimize(optPano);