<i>Tcl_FSCreateDirectory() aborts</i> status still Open with 4 other changes
by
.
D 2002-07-08T17:59:55
J icomment Logged\sIn:\sYES\s\nuser_id=32170\n\nThis\sobviously\sisn't\sideal,\sbut\scalling\sTcl_FSAnything\sin\s\nthat\sway\sis\sclearly\sgoing\sto\sleak\smemory\seven\sif\sthe\s\nresult\ssucceeds.\s\sThe\sdocs\sexplicitly\ssay\sthat\syou\s\nshould\snot\scall\sthese\sAPIs\swith\srefCounts\sof\szero:\n\n"The\s\\fBTcl_FS...\\fR\sare\sobjectified\sand\smay\scache\s\ninternal\nrepresentations\sand\sother\spath-related\sstrings\s(e.g.\sthe\s\ncurrent\nworking\sdirectory).\s\sOne\sside-effect\sof\sthis\sis\sthat\sone\s\nmust\sbe\ncareful\swhen\spassing\sin\stemporary\sobjects\swith\sa\s\nrefCount\sof\szero.\s\nUnder\ssome\scircumstances,\sthe\sfilesystem\scode\smay\s\nwish\sto\sretain\sa\nreference\sto\sthe\spassed\sin\sobject,\sand\sso\sone\smust\snot\s\nassume\sthat\nafter\sany\sof\sthese\scalls\sreturn,\sthe\sobject\sstill\shas\sa\s\nrefCount\sof\nzero\s-\sit\smay\shave\sbeen\sincremented.\s\sThe\spractical\s\nlesson\sto\slearn\nfrom\sthis\sis\sthat\s\\fBTcl_Obj\s*path\s=\sTcl_NewStringObj\n(...)\s;\nTcl_FS...(path)\s;\sTcl_DecrRefCount(path)\\fR\sis\swrong,\s\nand\smay\nsegfault.\s\sThe\s'path'\smust\shave\sits\srefCount\sincremented\s\nbefore\npassing\sit\sin,\sor\sdecrementing\sit."\n\nI'll\stry\sto\sfix\sthe\scrash\sin\sany\scase...\n
J login vincentdarley
J mimetype text/plain
J username vincentdarley
K 578617ffffffffffffffffffffffffffffffffff
U vincentdarley
Z 3934e178bb27641b5e149214345baea9