r599: no message
[ctsim.git] / src / threadproj.cpp
index 64216562ab82c04d1c5ec401ee30471db3067313..daf21d46c0fc944dcec75306b117d9e3a86bcb5c 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2001 Kevin Rosenberg
 **
-**  $Id: threadproj.cpp,v 1.7 2001/03/02 21:11:50 kevin Exp $
+**  $Id: threadproj.cpp,v 1.8 2001/03/02 21:32:34 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -155,7 +155,8 @@ ProjectorSupervisor::onDone()
 
   Projections* pProjections = getProjections();
 
-  wxMutexGuiEnter();
+  if (! wxThread::IsMain())
+    wxMutexGuiEnter();
   ProjectionFileDocument* pProjDoc = theApp->newProjectionDoc();
   if (! pProjDoc) {
     sys_error (ERR_SEVERE, "Unable to create projection file");
@@ -169,7 +170,8 @@ ProjectorSupervisor::onDone()
     projView->getFrame()->Show(true);
   }
   *theApp->getLog() << m_pszLabel << "\n";
-  wxMutexGuiLeave();
+  if (! wxThread::IsMain())
+    wxMutexGuiLeave();
 
   if (theApp->getAskDeleteNewDocs())
     pProjDoc->Modify (true);