Tk Source Code

Artifact [62f78ed6]
Login

Artifact 62f78ed6159530f273428fd179f0dfbfc54cc69166617f9db7c58013e79b5b1e:

Attachment "tkImage.diff" to ticket [0beaefa4] added by emiliano 2026-06-18 18:51:55.
Index: generic/tkImage.c
==================================================================
--- generic/tkImage.c
+++ generic/tkImage.c
@@ -1041,10 +1041,15 @@
 				 * to type information for image. */
 {
     TkWindow *winPtr = (TkWindow *) Tk_MainWindow(interp);
     Tcl_HashEntry *hPtr;
     ImageModel *modelPtr;
+
+    if (!winPtr) {
+	/* application has been destroyed */
+	return NULL;
+    }
 
     hPtr = Tcl_FindHashEntry(&winPtr->mainPtr->imageTable, name);
     if (hPtr == NULL) {
 	*typePtrPtr = NULL;
 	return NULL;