this patch contains additional code for keeping track of Tcl_Obj refcounts for debugging. It is switch on with th compile time flag -DOBJ_REF_COUNT_DEBUG. It maintains a list with references where the objects refcount was incremented/decremented. at the end one can call a dumping function to show all Tcl_Obj's where the refcount is still > 0. An extension writer can find the places for the extension in looking for the path part in the output. It is also possible to find Tcl_Obj's where the refcount is < -1.
enhanced version of the patch