Skip to content
Tcl Source Code Artifact [ed4250409b]
Login

Artifact [ed4250409b]

Artifact ed4250409bd844f6fe23700c0da1c981f31d5548:

Ticket change [ed4250409b] - Ticket [7368d225a657380c|7368d225a6] <i>Tcl_SetVar2() leaks memory</i> status still Open with 3 other changes by dgp on 2014-07-10 15:55:34.
D 2014-07-10T15:55:34.532
J icomment \r\nThis\sis\sa\sgap\sin\sthe\sfix\sfor\sbug\s1334947.\r\n\r\nhttp://core.tcl.tk/tcl/info/1334947\r\n\r\nFor\sall\sthe\ssame\sreasons\sthat\swas\sfixed\sin\s\r\na\smildly\sincompatible\sway,\sthis\sshould\salso\r\nbe\streated\sthe\ssame,\swith\sthe\sTcl_*SetVar*\r\nmachinery\staking\scare\sof\sall\szero-refcount\r\nvalue\shousekeeping\sto\srelieve\sall\scallers\r\nof\sthat\sburden.\r\n\r\nThose\sharmed\swill\sbe\sanyone\swith\scode\slike\sthis:\r\n\r\nTcl_Obj\s*value\s=\sTcl_New...();\r\nTcl_SetVar2Ex(interp,\s"foo",\sNULL,\svalue,\sTCL_APPEND_VALUE);\r\nTcl_DecrRefCount(value);\r\n\r\nAnyone\swith\ssuch\scode\slikely\shas\sthe\sTcl_DecrRefCount()\r\ncall\sin\splace\sonly\sbecause\sthey\sadded\sit\sto\splug\sthe\smemleak\r\nthat\swould\sotherwise\sbe\sobserved.\s\sWith\sthis\schange\sto\r\nthe\score,\sthat\scode\swill\shave\sto\smodified\sto\scontinue\sworking\r\nand\savoid\sa\ssegfault\s(same\sas\swe\sdid\swith\sthe\sother\s1334947\r\nchanges).\s\sIf\sthe\scode\smust\scontinue\srunning\swith\solder\sTcl\r\nreleases,\sthen\sthe\sfix\sis\sto\sadd\sa\r\n\r\nTcl_IncrRefCount(value);\r\n\r\ncall\sprior\sto\sSetVar\sso\sthat\srefcount\smanagement\sis\sbalanced.\r\n\r\nAny\ssuch\scode\swith\sthe\sluxury\sof\sditching\sall\sold\sTcl\sreleases\sand\r\nclaiming\ssupport\sof\ssolely\s8.5.16+\sand\s8.6.2+\scan\sjust\sdrop\r\nthe\sTcl_DecrRefCount()\scall\saltogether\sand\stake\sadvantage\sof\r\nthe\simproved\sinterface\sstandard.\r\n\r\nI\sexpect\sto\scount\sthe\snumber\sof\simpacted\susers\son\sone\shand.\r\nTCL_APPEND_VALUE\sis\sjust\snot\sa\spopular\sflag\soption\shere\sin\r\nmy\sexperience.
J login dgp
J mimetype text/plain
K 7368d225a657380c364ceb3fcf814bdba374a566
U dgp
Z 776ed55f66d00d6e4d51450967e77976