<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
But it's not a bug. Like Ali said:<br>
<br>
The destruction order of GC-maintained resources is not deterministic as e.g. in C++. It is quite possible that the member of an object is destroyed before the object itself.</blockquote><div><br></div><div>Oops. I get it now.</div>

<div><br></div><div>What should be done to avoid this situation? I think I need to add a destructor for the parent object class that would make sure that such child objects (that need the parent to be alive during GC process) are destroyed before the GC process kicks in. Would that be sufficient or would it again group such GC processes and still keep the sequence indeterminable? In that case, I will need to introduce a finalize() function which needs to be called explicitly. </div>

<div><br></div><div>Thanks and Regards</div><div>- Puneet</div></div>