Skip to content
Tcl Source Code Artifact [0a165629c8]
Login

Artifact [0a165629c8]

Artifact 0a165629c83abdb1c9f53e80e976c6b50fcecbb9:

Ticket change [0a165629c8] - New ticket [1ae12987cb21ae25|1ae12987cb] <i>Clean up history (::tcl::history) before/on exit (i.e., before exit handlers)</i>. by mr_calvin on 2016-10-21 14:37:03.
D 2016-10-21T14:37:03.937
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment The\sinternal\sevent\sstorage\sof\s::history\s(::tcl::history\sarray)\sis\snot\sexplicitly\scleared\swhen\sexiting\s(master\sinterp,\sTcl_Exit).\sExtensions'\sexit\shandlers,\stherefore,\spotentially\ssee\sunbalanced\srefcounts\son\sTcl_Objs\sreferenced\sfrom\s::tcl::history.\r\n\r\nSee\sfor\san\sexample\shttp://paste.tclers.tk/3973.\r\n\r\nPossible\saction\sitems:\r\n-\scall\s[::history::clear]\son\sTcl_Exit\s(not\sonly\sfor\sinterp\steardown).\r\n-\shave\s[rename\s::history\s{}]\srun\sthe\scleanup.\r\n\r\nExcerpt\sfrom\sthe\sIRC\sdiscussion\swith\sdgp\sand\sdkf\s():\r\n\r\nmr_calvin:\s(my\smain\squestion\sbasically\sis:\swhy\sis\san\sinteractive\stclsh\snot\scleaning\sup\sthe\s::tcl::history\sat\ssome\searly\spoint\sduring\sexit,\sbefore\sthe\sexit\shandlers\skick\sin.)\r\n\r\n<dgp>\sIIRC,\s[history]\sis\scoded\smostly\s(entirely?)\sin\sTcl?\r\n\r\n<dgp>\sAnd\sTcl\slacks\sgood\sinterface\sto\sexit\shandling.\r\n\r\nmr_calvin:\syeah\s…\slibrary/history.tcl\r\n\r\n<dkf>\sCould\sjust\smake\sTcl_Main\scall\s[history\sclear]\son\sthe\sway\sout?\r\n\r\n<dgp>\sno\r\n\r\n<dkf>\sas\shandling\sall\scases\s*very*\shard\r\n\r\n<dgp>\sthis\scleanup\swould\snormally\sbe\shandled\sby\sinterp\steardown\r\n\r\n<dgp>\s....that\s[exit]\sdoes\snot\stear\sdown\sinterps.\r\n\r\n<dkf>\sif\syou\shave\ssomething\sthat\sneeds\sto\sbe\sfreed,\syou\sneed\san\sexit\shandler\sand\sthose\sREQUIRE\sthe\sC\sAPI\sto\sset\sup\r\n\r\ndkf:\sas\sI\swrote\sa\slittle\searlier.\swe\sdo\sinternal\sbookkeeping\son\sTcl_Objs\sintreps\sin\sNSF/NX,\son\sexit,\swe\sdraw\sthe\sbalance\s(exit\shandler)\sand\sreferences\sfrom\stcl::history\sshow\sup\sas\sunbalanced\srefcounts.\r\n\r\n<dkf>\sbut\seffectively\swe\s*know*\sthere\sare\sreferences\sretained\sunless\syou\sfinalize\r\n\r\nmr_calvin:\sbut\sdoing\sa\s“unset\s-nocomplain\s::tcl::history”\sin\sour\sexit\shandler\swould\sbe\sone\soption\s(at\sleast\sin\sour\smemdebug\sbuild)\sto\sbalance\sthose\srefcounts\sin\stime,\swouldn’t\sit?\r\n\r\n<dkf>\s[::history\sclear]\swould\sleave\sme\shappier\s\r\n\r\n<dgp>\sDoes\s[rename\shistory\s{}]\sdo\sa\scleanup?\r\n\r\n<dkf>\sprobably\snot\r\n\r\n<dgp>\sthat\swould\sbe\sa\sbug\sworth\sfixing.
J foundin core-8-6-branch
J is_private 0
J login mr_calvin
J priority 5\sMedium
J private_contact d4d1d8192a46acf2c7d58cddc1040ecdbc9c9d77
J resolution None
J severity Minor
J status Open
J submitter mr_calvin
J subsystem 19.\s[history]
J title Clean\sup\shistory\s(::tcl::history)\sbefore/on\sexit\s(i.e.,\sbefore\sexit\shandlers)
J type Bug
K 1ae12987cb21ae25cdb699d9c41d2596d8bd0035
U mr_calvin
Z 355e85c0e18542c06521de344e945ce4