On Oct 15, 2006, at 1:01 PM, Justin Bonnar wrote:

> I'm writting a wrapper for a C library[1] and need to perform some
> clean-up when the Ruby process exists.  In my Init function, I  
> create a
> C global variable that needs to be explicitly freed after the garbage
> collector has finished cleaning up all Ruby objects.  How should  
> this be
> done?

Chapter 21 of the Pickaxe (2nd ed) is what you want. It covers this  
topic fairly well.