: <i>Unexpected behavior / Panic / Tcl_Obj deletion management</i> plus 4 other changes
by
.
D 2012-01-19T01:29:27
J icomment please\sread\scarefully\smy\sexample\scode.\si\sknow\swhat\sshared\sobject\sis.\nthe\sexception\sresp.\spanic\soccured\sstandalone\sin\stcl\score\salso,\slike\scall\sof\sthis\sin\sfreeIntRepProc\s(by\sDeletePending)\s:\n\s\s\sfile\snormalize\s{D:\\test\\bin\\..\\modules\\tcl\\lib\\tcl8.5\\init.tcl}.\s\nin\smy\sexample\scode\s(if\syou\sread\scarefully)\s...\sbefore\scall\sof\sTcl_SetObjLength(obj,\s0)\sthe\srefCount\sshould\sbe\s"1",\sand\sis\s"1"\snormally,\nbut\sby\sDeletePending\sit\sis\s"2".\nOr\syou\swant\sto\stell\sme\s-\syou\swrite\sbefore\seach\smodification\scall\sthis\s:\n<code>\nif\s(Tcl_IsShared(retVal))\s{\n\sTclDecrRefCount(retVal);\n\sretVal\s=\sTcl_DuplicateObj(retVal);\n\sTclIncrRefCount(retVal);\n}\n</code>\nI\sdo\sit\sso,\sbut\sonly\sby\sobject,\swhich\srefCount\si\sdon't\sknow.\sIn\smy\sexample\srefCount\sof\s"obj"\sshould\sbe\sdefinitely\s"1".\nOtherwise\sthe\stcl8.5\scode\sshould\sbe\salso\scompletelly\srevised.\n
J login sebres
J mimetype text/plain
J status Open
J username sebres
K 3475569fffffffffffffffffffffffffffffffff
U sebres
Z 64aeabffee32212fced5ec6a86e52e9c