summaryrefslogtreecommitdiffstats
path: root/doc/AddErrInfo.3
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-02-21 10:25:45 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-02-21 10:25:45 (GMT)
commitf40cc098f4cfadea6aa0a597de897558fc92e427 (patch)
treea7cb8c82b5a74a7d1a873366b73a4df45268ab33 /doc/AddErrInfo.3
parentdad62da8e9bb494746f173ab59d4733ba2f4629a (diff)
downloadtcl-f40cc098f4cfadea6aa0a597de897558fc92e427.zip
tcl-f40cc098f4cfadea6aa0a597de897558fc92e427.tar.gz
tcl-f40cc098f4cfadea6aa0a597de897558fc92e427.tar.bz2
Documentation clarification, as discussed in [Bug 3482614].
Diffstat (limited to 'doc/AddErrInfo.3')
-rw-r--r--doc/AddErrInfo.36
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/AddErrInfo.3 b/doc/AddErrInfo.3
index 4087b41..e450a3e 100644
--- a/doc/AddErrInfo.3
+++ b/doc/AddErrInfo.3
@@ -108,6 +108,11 @@ by \fBTcl_GetReturnOptions\fR points to an unshared
\fBTcl_Obj\fR with reference count of zero. The dictionary
may be written to, either adding, removing, or overwriting
any entries in it, without the need to check for a shared object.
+As with any \fBTcl_Obj\fR with reference count of zero, it is up to
+the caller to arrange for its disposal with \fBTcl_DecrRefCount\fR or
+to a reference to it via \fBTcl_IncrRefCount\fR (or one of the many
+functions that call that, notably including \fBTcl_SetObjResult\fR and
+\fBTcl_SetVar2Ex\fR).
.PP
A typical usage for \fBTcl_GetReturnOptions\fR is to
retrieve the stack trace when script evaluation returns
@@ -123,6 +128,7 @@ if (code == TCL_ERROR) {
Tcl_DictObjGet(NULL, options, key, &stackTrace);
Tcl_DecrRefCount(key);
/* Do something with stackTrace */
+ Tcl_DecrRefCount(options);
}
.CE
.PP