summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/tkWinMenu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index 909237c..e70cf70 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -1238,11 +1238,13 @@ TkWinHandleMenuEvent(
interp = menuPtr->interp;
Tcl_Preserve(interp);
+ Tcl_Preserve(menuPtr);
code = TkInvokeMenu(interp, menuPtr, mePtr->index);
if (code != TCL_OK && code != TCL_CONTINUE && code != TCL_BREAK) {
Tcl_AddErrorInfo(interp, "\n (menu invoke)");
Tcl_BackgroundException(interp, code);
}
+ Tcl_Release(menuPtr);
Tcl_Release(interp);
*plResult = 0;
returnResult = 1;