Changing procedure to end execution of Tcl according to the documentation to prevent crashes
if (cc && Draw::Atoi(cc)) {
#ifdef WNT
- Tcl_Exit(0);
+ Tcl_Finalize();
#else
Tcl_Eval(interp,"exit");
#endif
#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
}
#else
#ifdef WNT
- Tcl_Exit(0);
+ Tcl_Finalize();
#endif
#endif
}
if (count < 0) {
if (!gotPartial) {
if (tty) {
- Tcl_Exit(0);
+ Tcl_Finalize();
} else {
Tcl_DeleteChannelHandler(chan, StdinProc, (ClientData) chan);
}
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"));
}
toLoop = (Tk_GetNumMainWindows() > 0) || Draw_VirtualWindows;
#endif
}
- Tcl_Exit(0);
+ Tcl_Finalize();
return 0;
}