From 03e15875540e77c1ee40fbeb63955bb50eade596 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 11 Feb 2016 13:11:28 +0000 Subject: (cherry-pick): Fix crash in TkFinalize() if Tk_Init() is never called. Suggested by Brian Griffin. --- generic/tkEvent.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/generic/tkEvent.c b/generic/tkEvent.c index 03e7283..747555e 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -2047,6 +2047,12 @@ TkFinalize( { ExitHandler *exitPtr; +#if defined(_WIN32) && !defined(STATIC_BUILD) + if (!tclStubsPtr) { + return; + } +#endif + Tcl_DeleteExitHandler(TkFinalize, NULL); Tcl_MutexLock(&exitMutex); -- cgit v0.12