summaryrefslogtreecommitdiffstats
path: root/generic/tkMenuDraw.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-07-15 13:59:05 (GMT)
committervincentdarley <vincentdarley>2003-07-15 13:59:05 (GMT)
commit809c5a269834bf1dc30edbba8d1d813dfd56f08d (patch)
treefc758135ae55e7de4390f758cfc9f85b9fe64560 /generic/tkMenuDraw.c
parentc23f527d3060e379f4dc461df50d4181fadea10a (diff)
downloadtk-809c5a269834bf1dc30edbba8d1d813dfd56f08d.zip
tk-809c5a269834bf1dc30edbba8d1d813dfd56f08d.tar.gz
tk-809c5a269834bf1dc30edbba8d1d813dfd56f08d.tar.bz2
menu clone cleanup bug fix
Diffstat (limited to 'generic/tkMenuDraw.c')
-rw-r--r--generic/tkMenuDraw.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c
index 42cdf43..ee1e89e 100644
--- a/generic/tkMenuDraw.c
+++ b/generic/tkMenuDraw.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMenuDraw.c,v 1.3 1999/04/16 01:51:19 stanton Exp $
+ * RCS: @(#) $Id: tkMenuDraw.c,v 1.3.20.1 2003/07/15 13:59:06 vincentdarley Exp $
*/
#include "tkMenu.h"
@@ -769,15 +769,26 @@ TkMenuEventProc(clientData, eventPtr)
}
} else if (eventPtr->type == DestroyNotify) {
if (menuPtr->tkwin != NULL) {
- TkDestroyMenu(menuPtr);
+ if (!(menuPtr->menuFlags & MENU_DELETION_PENDING)) {
+ TkDestroyMenu(menuPtr);
+ }
menuPtr->tkwin = NULL;
+ }
+ if (menuPtr->menuFlags & MENU_WIN_DESTRUCTION_PENDING) {
+ return;
+ }
+ menuPtr->menuFlags |= MENU_WIN_DESTRUCTION_PENDING;
+ if (menuPtr->widgetCmd != NULL) {
Tcl_DeleteCommandFromToken(menuPtr->interp, menuPtr->widgetCmd);
+ menuPtr->widgetCmd = NULL;
}
if (menuPtr->menuFlags & REDRAW_PENDING) {
Tcl_CancelIdleCall(DisplayMenu, (ClientData) menuPtr);
+ menuPtr->menuFlags &= ~REDRAW_PENDING;
}
if (menuPtr->menuFlags & RESIZE_PENDING) {
Tcl_CancelIdleCall(ComputeMenuGeometry, (ClientData) menuPtr);
+ menuPtr->menuFlags &= ~RESIZE_PENDING;
}
Tcl_EventuallyFree((ClientData) menuPtr, TCL_DYNAMIC);
}