summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Mistachkin <joe@mistachkin.com>2011-11-18 01:01:37 (GMT)
committerJoe Mistachkin <joe@mistachkin.com>2011-11-18 01:01:37 (GMT)
commitc0089bebf222935ebedd937985ee0c73de5767de (patch)
treec9ab5d5351739a71a886d39ff57055f3d327b00d
parent206047c64c05dcec08d93af6860fea9662f667b8 (diff)
downloadtcl-c0089bebf222935ebedd937985ee0c73de5767de.zip
tcl-c0089bebf222935ebedd937985ee0c73de5767de.tar.gz
tcl-c0089bebf222935ebedd937985ee0c73de5767de.tar.bz2
For [testthread cancel], avoid creating a new Tcl_Obj when the default script cancellation result is desired.
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclThreadTest.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 83e5703..0932130 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-17 Joe Mistachkin <joe@mistachkin.com>
+
+ * generic/tclThreadTest.c: For [testthread cancel], avoid creating a
+ new Tcl_Obj when the default script cancellation result is desired.
+
2011-11-11 Donal K. Fellows <dkf@users.sf.net>
* win/tclWinConsole.c: Refactor common thread handling patterns.
diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c
index 3345081..22b5995 100644
--- a/generic/tclThreadTest.c
+++ b/generic/tclThreadTest.c
@@ -988,7 +988,8 @@ ThreadCancel(
Tcl_MutexUnlock(&threadMutex);
Tcl_ResetResult(interp);
- return Tcl_CancelEval(tsdPtr->interp, Tcl_NewStringObj(result, -1), 0, flags);
+ return Tcl_CancelEval(tsdPtr->interp,
+ (result != NULL) ? Tcl_NewStringObj(result, -1) : NULL, 0, flags);
}
/*