Subject: Fix crash in TkFinalize() if Tk_Init() is never called. Suggested by Brian Griffin.

From: "jan.nijtmans" <[email-masked]>
Date: Thu, 11 Feb 2016 13:09:34 +0000

---
 generic/tkEvent.c | 6 ++++++
 1 file changed, 6 insertions(+)

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);
-- 
cgit v0.12