From f884f275a1ae02b0a08fc22fd3c075d64394a352 Mon Sep 17 00:00:00 2001
From: fvogel <fvogelnew1@free.fr>
Date: Sat, 13 Jan 2018 13:50:46 +0000
Subject: [PATCH 107/693] Fix [657c389120] and [b4214b4712]: Segfault when
 destroying menu with checkbutton entry

---
 generic/tkMenu.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index d24516f6a..42ddbd5ec 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -2495,6 +2495,11 @@ MenuVarProc(
     }
 
     menuPtr = mePtr->menuPtr;
+
+    if (menuPtr->menuFlags & MENU_DELETION_PENDING) {
+    	return NULL;
+    }
+
     name = Tcl_GetString(mePtr->namePtr);
 
     /*
-- 
2.19.1

