]> OCCT Git - occt-copy.git/commitdiff
0026347: Crash on the application close CR26347
authoranv <anv@opencascade.com>
Wed, 17 Jun 2015 08:38:06 +0000 (11:38 +0300)
committeranv <anv@opencascade.com>
Wed, 17 Jun 2015 09:31:42 +0000 (12:31 +0300)
Changing procedure to end execution of Tcl according to the documentation to prevent crashes

src/Draw/Draw_Interpretor.cxx
src/Draw/Draw_Window.cxx

index df09c8bdf6d6876b674ccb926086943610059407..cf9753fa6cc669e03b658a107e58911aa7dbb0a2 100644 (file)
@@ -199,7 +199,7 @@ static Standard_Integer CommandCmd
 
     if (cc && Draw::Atoi(cc)) {
 #ifdef WNT
-      Tcl_Exit(0);
+      Tcl_Finalize();
 #else      
       Tcl_Eval(interp,"exit");
 #endif
@@ -558,7 +558,7 @@ Draw_Interpretor::~Draw_Interpretor()
 #if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)))
   try {
     OCC_CATCH_SIGNALS
-    Tcl_Exit(0);
+    Tcl_Finalize();
   }
   catch (Standard_Failure) {
 #ifdef OCCT_DEBUG
@@ -567,7 +567,7 @@ Draw_Interpretor::~Draw_Interpretor()
   }
 #else
 #ifdef WNT
-  Tcl_Exit(0);
+  Tcl_Finalize();
 #endif  
 #endif
 }
index ddebf5a682062854bdc310e40a8b3f6c6aa16faa..67c9d18d9047f6df4208740dc9df194f2311afc2 100644 (file)
@@ -1206,7 +1206,7 @@ static void StdinProc(ClientData clientData, int )
   if (count < 0) {
     if (!gotPartial) {
       if (tty) {
-        Tcl_Exit(0);
+        Tcl_Finalize();
       } else {
         Tcl_DeleteChannelHandler(chan, StdinProc, (ClientData) chan);
       }
@@ -2103,7 +2103,7 @@ static DWORD WINAPI tkLoop(VOID)
       fprintf (stderr, "%s\n", interp->result);
 #endif
       cout << "tkLoop: Tk_MainWindow() returned NULL. Exiting...\n";
-      Tcl_Exit (0);
+      Tcl_Finalize();
     }
     Tk_Name(mainWindow) = Tk_GetUid (Tk_SetAppName (mainWindow, "Draw"));
   }
@@ -2147,7 +2147,7 @@ static DWORD WINAPI tkLoop(VOID)
     toLoop = (Tk_GetNumMainWindows() > 0) || Draw_VirtualWindows;
   #endif
   }
-  Tcl_Exit(0);
+  Tcl_Finalize();
   return 0;
 }