summaryrefslogtreecommitdiffstats
path: root/generic/tkMenu.c
diff options
context:
space:
mode:
authorjenglish@flightlab.com <jenglish>2010-02-17 20:57:03 (GMT)
committerjenglish@flightlab.com <jenglish>2010-02-17 20:57:03 (GMT)
commit6445840fda35aa5db90ed125e02b9ec16da798e8 (patch)
tree847ae413d0ccc85841be081e9b003f6a636dfeba /generic/tkMenu.c
parentd6a4433c93bbe4e5e86b9fdbc9f1b314a6feac70 (diff)
downloadtk-6445840fda35aa5db90ed125e02b9ec16da798e8.zip
tk-6445840fda35aa5db90ed125e02b9ec16da798e8.tar.gz
tk-6445840fda35aa5db90ed125e02b9ec16da798e8.tar.bz2
generic/tkMenu.c: Defer TkMenuOptionTables cleanup to CallWhenDeleted() time,
to ensure that the record doesn't get freed until after all widget instance commands have been deleted (Fixes [Bug#2952745]).
Diffstat (limited to 'generic/tkMenu.c')
-rw-r--r--generic/tkMenu.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index b2bbf88..ecba7ba 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMenu.c,v 1.20.2.8 2009/02/06 08:14:29 das Exp $
+ * RCS: @(#) $Id: tkMenu.c,v 1.20.2.9 2010/02/17 20:57:03 jenglish Exp $
*/
/*
@@ -402,7 +402,8 @@ static Tk_ClassProcs menuClass = {
static void
FreeOptionTables(
- ClientData clientData)
+ ClientData clientData,
+ Tcl_Interp *interp)
{
ckfree(clientData);
}
@@ -430,8 +431,8 @@ TkCreateMenuCmd(interp)
optionTablesPtr->entryOptionTables[CHECK_BUTTON_ENTRY] =
Tk_CreateOptionTable(interp, specsArray[CHECK_BUTTON_ENTRY]);
- Tcl_CreateObjCommand(interp, "menu", MenuCmd,
- (ClientData) optionTablesPtr, FreeOptionTables);
+ Tcl_CreateObjCommand(interp, "menu", MenuCmd, optionTablesPtr, 0);
+ Tcl_CallWhenDeleted(interp, FreeOptionTables, optionTablesPtr);
if (Tcl_IsSafe(interp)) {
Tcl_HideCommand(interp, "menu", "menu");