c# - Is it necessary to free objects in final block of try-catch block? -
the question self explanatory :
foo objfoo; try { objfoo = new foo(); .......... ......... } catch { } { objfoo = null; } is necessary free objects ?
note: setting local / field null not freeing value. instead removing reference value may or may not make elligable collection during next gc cyle.
to answer question, no not necessary. jit`er calculate last time local used , remove local 1 of object's gc roots @ time. nulling local out not speed process.
raymond chen did excellent article on subject
Comments
Post a Comment