From f40cc098f4cfadea6aa0a597de897558fc92e427 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 21 Feb 2012 10:25:45 +0000 Subject: Documentation clarification, as discussed in [Bug 3482614]. --- doc/AddErrInfo.3 | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v0.12