Well, this seems to have repercussions - today I would check my idea with new flag <code>TCL_OWN_OBJREF</code> and have verified at which places everywhere in tcl (and some modules like thread, etc) it may be needed.
Thereby I found many places, where it's currently wrong (e. g. usage of released object, wrong free or even leaks).<br/>
Too many to list all this here...<br/>
Just as an example, see <a matchVarObj, NULL, emptyObj, ...)</a> that will use already released object <code>emptyObj</code> if 10 lines <a the same object <code>emptyObj</code> will be released in trace by <code>Tcl_ObjSetVar2(..., indexVarObj, NULL, emptyObj, ...) </code>.
Note that in current versions this does not have <code>Tcl_DecrRefCount(emptyObj)</code> in error cases (since auto-release in but it does no matter because this can be released in trace by set.

I would like to fix all such errors (and similar) for 8.5th, 8.6th and trunk branches (together with introducing of already suggested new flag TCL_OWN_OBJREF or using some other solution like new internal function <code>TclObjOwnAndSetVar</code>), but firstly I would like to know what TCT thinks about (new flag?, new function?, something other?).
IMHO but (very-very controversial) auto-release made in is not really a solution and should be rewritten.

Please note also, that this behavior is undocumented, so many people make still:
<code><pre>
Tcl_Obj *newObj = SomethingReturnsNewObjOfTypeX(...);
if (Tcl_ObjSetVar2(..., varObj, NULL, newObj, ...) == NULL) {
  Tcl_DecrRefCount(newObj);
  return TCL_ERROR;
}

What is currently wrong (because since it is double decreased, and can cause segfault).