Are all C destructors, i.e., the “free” function that is specified in
Data_Make_Struct (VALUE, c-type, mark, “free”, c-type*), guaranteed to be
called when the Ruby script/process exits?
I put “printf” on all the “free” functions, and one of them did not get
called. Is it a sign that something is still not clean? How about
circular reference (I think I have one in my code)? Will circular
reference cause the free function not called at the end of the
I know that in Python circular reference can cause trouble since it gc
uses reference counting. But Ruby gc uses mark-and-sweep method.