summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-10-02 20:59:26 (GMT)
committerhobbs <hobbs>2002-10-02 20:59:26 (GMT)
commit35ee67d3da1d3d2bc5b463e16837451550387d1c (patch)
tree8217af7d57954b413033a928a2ac4d64c9a7c6e7
parentdb14d3e554404d079d9ac125594e876a6fb0aa88 (diff)
downloadtk-35ee67d3da1d3d2bc5b463e16837451550387d1c.zip
tk-35ee67d3da1d3d2bc5b463e16837451550387d1c.tar.gz
tk-35ee67d3da1d3d2bc5b463e16837451550387d1c.tar.bz2
* tests/entry.test: added entry-20.7
* generic/tkEntry.c (EntryTextVarProc): check if the entry if being deleted before handling an associated textvariable. [Bug #607390 #617446]
-rw-r--r--ChangeLog7
-rw-r--r--generic/tkEntry.c9
-rw-r--r--tests/entry.test12
3 files changed, 26 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ed7536f..bd42d5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-10-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/entry.test: added entry-20.7
+ * generic/tkEntry.c (EntryTextVarProc): check if the entry if
+ being deleted before handling an associated textvariable.
+ [Bug #607390 #617446]
+
2002-10-01 Donal K. Fellows <fellowsd@cs.man.ac.uk>
* tests/unixSelect.test (unixSelect-1.1[89]): Altered these tests
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 53e0d60..51c459c 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkEntry.c,v 1.31 2002/08/05 04:30:38 dgp Exp $
+ * RCS: @(#) $Id: tkEntry.c,v 1.32 2002/10/02 20:59:26 hobbs Exp $
*/
#include "tkInt.h"
@@ -3295,6 +3295,13 @@ EntryTextVarProc(clientData, interp, name1, name2, flags)
Entry *entryPtr = (Entry *) clientData;
CONST char *value;
+ if (entryPtr->flags & ENTRY_DELETED) {
+ /*
+ * Just abort early if we entered here while being deleted.
+ */
+ return (char *) NULL;
+ }
+
/*
* If the variable is unset, then immediately recreate it unless
* the whole interpreter is going away.
diff --git a/tests/entry.test b/tests/entry.test
index 5c6265f..effa631 100644
--- a/tests/entry.test
+++ b/tests/entry.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: entry.test,v 1.12 2002/07/14 05:48:46 dgp Exp $
+# RCS: @(#) $Id: entry.test,v 1.13 2002/10/02 20:59:28 hobbs Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -1588,6 +1588,16 @@ test entry-20.6 {widget deletion while active} {
update idle
winfo exists .e
} 0
+test entry-20.7 {widget deletion with textvariable active} {
+ # SF bugs 607390 and 617446
+ destroy .e
+ set FOO init
+ entry .e -textvariable FOO -validate all \
+ -vcmd {%W configure -bg white; format 1}
+ bind .e <Destroy> { set FOO hello }
+ destroy .e
+ winfo exists .e
+} 0
# XXX Still need to write tests for EntryBlinkProc, EntryFocusProc,
# and EntryTextVarProc.