<div class="gmail_quote">On Fri, Mar 23, 2012 at 3:43 AM, Ali Çehreli <span dir="ltr"><<a href="mailto:acehreli@yahoo.com">acehreli@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">You can register on GC if you wrap the resources in a class. Then the class object's destructor would call the clean up code. The problem is, it is undeterministic when the destructor will be called, or will it be called at all!</div>
</div>
<br>
Or you can wrap in a struct which has deterministic destruction like in C++, when leaving scopes.<br></blockquote><div><br></div><div><br></div><div>The object is long lived, so the class wrapper is the way to go.</div><div>
Thanks</div><div><br></div></div>