diff options
author | hobbs <hobbs> | 2001-12-28 01:23:47 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2001-12-28 01:23:47 (GMT) |
commit | 59a2e554827fbd627e7e4c24eb5c0121ada20721 (patch) | |
tree | 2a575179fb5114fa5eb0938d5157c37964ccb849 /generic | |
parent | 3cd7dcd403aceed536f9e2f2a4c8a7053afb8e8f (diff) | |
download | tk-59a2e554827fbd627e7e4c24eb5c0121ada20721.zip tk-59a2e554827fbd627e7e4c24eb5c0121ada20721.tar.gz tk-59a2e554827fbd627e7e4c24eb5c0121ada20721.tar.bz2 |
* generic/tkButton.c (ButtonTextVarProc): guard against being
called while the *button/label is being deleted. [Bug #490051]
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkButton.c | 8 |
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); /* |