diff options
author | jenglish <jenglish@flightlab.com> | 2010-02-17 20:58:01 (GMT) |
---|---|---|
committer | jenglish <jenglish@flightlab.com> | 2010-02-17 20:58:01 (GMT) |
commit | 8453d3cccbea40ae4ddb7145ba3fdaae9f034906 (patch) | |
tree | b3f95238a5cbd1c1f745dc61493abb6ee4701044 /generic | |
parent | 7aeef24801bca6f67631d1a48958dd16f7066364 (diff) | |
download | tk-8453d3cccbea40ae4ddb7145ba3fdaae9f034906.zip tk-8453d3cccbea40ae4ddb7145ba3fdaae9f034906.tar.gz tk-8453d3cccbea40ae4ddb7145ba3fdaae9f034906.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')
-rw-r--r-- | generic/tkMenu.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 7af304e..122b33a 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.41.2.4 2010/01/05 09:44:54 dkf Exp $ + * RCS: @(#) $Id: tkMenu.c,v 1.41.2.5 2010/02/17 20:58:01 jenglish Exp $ */ /* @@ -395,7 +395,8 @@ static Tk_ClassProcs menuClass = { static void FreeOptionTables( - ClientData clientData) + ClientData clientData, + Tcl_Interp *interp) { ckfree(clientData); } @@ -423,8 +424,8 @@ TkCreateMenuCmd( 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"); |