summaryrefslogtreecommitdiffstats
path: root/generic/tkMenu.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-02-10 08:52:32 (GMT)
committerhobbs <hobbs>2000-02-10 08:52:32 (GMT)
commit6e3c3db8630f629578ea034020ae7d920aadf4ce (patch)
tree40bf71711635d8e5ad5dc9afe14eb82905661051 /generic/tkMenu.c
parent6f20b944ba77825f85992c2f0bcff2dc497236df (diff)
downloadtk-6e3c3db8630f629578ea034020ae7d920aadf4ce.zip
tk-6e3c3db8630f629578ea034020ae7d920aadf4ce.tar.gz
tk-6e3c3db8630f629578ea034020ae7d920aadf4ce.tar.bz2
* generic/tkImgGIF.c (FileReadGIF): added cast for trashBuffer
* generic/tkIntXlibDecls.h: * generic/tkInt.decls: declared some Xlib emulation calls for the Mac * generic/tkFrame.c (TkInstallFrameMenu): added extra panic to inform user of bad call when framePtr is NULL [Bug: 2530] * generic/tkMenu.c (DestroyMenuInstance): Placed checks around menu name objects before trying to incr the ref. [Bug: 3402] * generic/tkTest.c: removed USE_OLD_IMAGE def for Mac
Diffstat (limited to 'generic/tkMenu.c')
-rw-r--r--generic/tkMenu.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 806e513..b3f906d 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.5 1999/04/21 21:53:26 rjohnson Exp $
+ * RCS: @(#) $Id: tkMenu.c,v 1.6 2000/02/10 08:52:35 hobbs Exp $
*/
/*
@@ -1178,11 +1178,17 @@ DestroyMenuInstance(menuPtr)
parentMasterMenuPtr->entries[cascadePtr->index];
newObjv[0] = menuNamePtr;
newObjv[1] = parentMasterEntryPtr->namePtr;
- Tcl_IncrRefCount(newObjv[0]);
- Tcl_IncrRefCount(newObjv[1]);
- ConfigureMenuEntry(cascadePtr, 2, newObjv);
- Tcl_DecrRefCount(newObjv[0]);
- Tcl_DecrRefCount(newObjv[1]);
+ /*
+ * It is possible that the menu info is out of sync, and
+ * these things point to NULL, so verify existence [Bug: 3402]
+ */
+ if (newObjv[0] && newObjv[1]) {
+ Tcl_IncrRefCount(newObjv[0]);
+ Tcl_IncrRefCount(newObjv[1]);
+ ConfigureMenuEntry(cascadePtr, 2, newObjv);
+ Tcl_DecrRefCount(newObjv[0]);
+ Tcl_DecrRefCount(newObjv[1]);
+ }
} else {
ConfigureMenuEntry(cascadePtr, 0, (Tcl_Obj **) NULL);
}