<div dir="ltr"><div class="gmail_extra">It is an old question about finalizators in GC languages.</div><div class="gmail_extra"><br></div><div class="gmail_extra">If you want determined time of deallocation of resources, then you must do it explicitly and handle  deallocated state of your NIF resource later</div></div>