summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-02-11 13:09:34 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-02-11 13:09:34 (GMT)
commit4dd26486a8997a2706c8c9369c4a17706c33e114 (patch)
tree27e2346af3e48258f7aafc2157f2b33291ebf0ec
parent8f151700b10bf8811876305e284738707d4ad237 (diff)
downloadtk-4dd26486a8997a2706c8c9369c4a17706c33e114.zip
tk-4dd26486a8997a2706c8c9369c4a17706c33e114.tar.gz
tk-4dd26486a8997a2706c8c9369c4a17706c33e114.tar.bz2
Fix crash in TkFinalize() if Tk_Init() is never called. Suggested by Brian Griffin.
-rw-r--r--generic/tkEvent.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/generic/tkEvent.c b/generic/tkEvent.c
index bcc6d98..95aeda1 100644
--- a/generic/tkEvent.c
+++ b/generic/tkEvent.c
@@ -2039,6 +2039,12 @@ TkFinalize(
{
ExitHandler *exitPtr;
+#if defined(_WIN32) && !defined(STATIC_BUILD)
+ if (!tclStubsPtr) {
+ return;
+ }
+#endif
+
Tcl_DeleteExitHandler(TkFinalize, NULL);
Tcl_MutexLock(&exitMutex);