summaryrefslogtreecommitdiffstats
path: root/generic/tkButton.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-12-28 01:23:47 (GMT)
committerhobbs <hobbs>2001-12-28 01:23:47 (GMT)
commit9bfff117af205f7600da2c27660086789243fa14 (patch)
tree2a575179fb5114fa5eb0938d5157c37964ccb849 /generic/tkButton.c
parent04419abd89a3f566d4d489895c78cd9950928144 (diff)
downloadtk-9bfff117af205f7600da2c27660086789243fa14.zip
tk-9bfff117af205f7600da2c27660086789243fa14.tar.gz
tk-9bfff117af205f7600da2c27660086789243fa14.tar.bz2
* generic/tkButton.c (ButtonTextVarProc): guard against being
called while the *button/label is being deleted. [Bug #490051]
Diffstat (limited to 'generic/tkButton.c')
-rw-r--r--generic/tkButton.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tkButton.c b/generic/tkButton.c
index 3e835fb..dca60a4 100644
--- a/generic/tkButton.c
+++ b/generic/tkButton.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkButton.c,v 1.13 2001/08/29 23:22:24 hobbs Exp $
+ * RCS: @(#) $Id: tkButton.c,v 1.14 2001/12/28 01:23:47 hobbs Exp $
*/
#include "tkButton.h"
@@ -942,9 +942,9 @@ static void
DestroyButton(butPtr)
TkButton *butPtr; /* Info about button widget. */
{
+ butPtr->flags |= BUTTON_DELETED;
TkpDestroyButton(butPtr);
- butPtr->flags |= BUTTON_DELETED;
if (butPtr->flags & REDRAW_PENDING) {
Tcl_CancelIdleCall(TkpDisplayButton, (ClientData) butPtr);
}
@@ -1625,6 +1625,10 @@ ButtonTextVarProc(clientData, interp, name1, name2, flags)
char *name;
Tcl_Obj *valuePtr;
+ if (butPtr->flags & BUTTON_DELETED) {
+ return (char *) NULL;
+ }
+
name = Tcl_GetString(butPtr->textVarNamePtr);
/*