diff options
author | jenglish <jenglish@flightlab.com> | 2010-02-17 20:58:32 (GMT) |
---|---|---|
committer | jenglish <jenglish@flightlab.com> | 2010-02-17 20:58:32 (GMT) |
commit | 09e45d149fcc63d92f4bee4d5db56a420c67d8ad (patch) | |
tree | 8214c2258844d5803a70a46f356c4710bd0687d5 | |
parent | 08118cf0531836d38a11540a687c8a92842014d5 (diff) | |
download | tk-09e45d149fcc63d92f4bee4d5db56a420c67d8ad.zip tk-09e45d149fcc63d92f4bee4d5db56a420c67d8ad.tar.gz tk-09e45d149fcc63d92f4bee4d5db56a420c67d8ad.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]).
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | generic/tkMenu.c | 9 |
2 files changed, 12 insertions, 4 deletions
@@ -1,3 +1,10 @@ +2010-02-17 Joe English <jenglish@users.sourceforge.net> + + * 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]). + 2010-02-17 Jan Nijtmans <nijtmans@users.sf.net> * generic/tk.decls CONSTify everything related to Tk_ConfigSpec diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 8da4cb7..f044370 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.58 2010/01/18 20:43:38 nijtmans Exp $ + * RCS: @(#) $Id: tkMenu.c,v 1.59 2010/02/17 20:58:32 jenglish Exp $ */ /* @@ -398,7 +398,8 @@ static const Tk_ClassProcs menuClass = { static void FreeOptionTables( - ClientData clientData) + ClientData clientData, + Tcl_Interp *interp) { ckfree(clientData); } @@ -426,8 +427,8 @@ TkCreateMenuCmd( optionTablesPtr->entryOptionTables[CHECK_BUTTON_ENTRY] = Tk_CreateOptionTable(interp, specsArray[CHECK_BUTTON_ENTRY]); - Tcl_CreateObjCommand(interp, "menu", MenuCmd, optionTablesPtr, - FreeOptionTables); + Tcl_CreateObjCommand(interp, "menu", MenuCmd, optionTablesPtr, 0); + Tcl_CallWhenDeleted(interp, FreeOptionTables, optionTablesPtr); if (Tcl_IsSafe(interp)) { Tcl_HideCommand(interp, "menu", "menu"); |