From: Admin Tensor Date: 2012-11-22T00:45:11+09:00 Subject: Re: C Extension Shutdown GC vs Free Functions Called Robert Buck wrote in post #1085679: > For what its worth, I just tried hooking into the at exit hook at the > C/C++ side. But that gets called AFTER Ruby bulk dumps/deletes all > objects out of order. I was hoping to have this intercepted prior to > global object deletion so that I could put the driver into a special > mode, the don't free anything mode (since memory will be cleaned up > anyways when the proc terminates). Hi, I am sorry that I don't know the precise situation. If you just want memory to be cleaned up automatically when the proc terminates, then in Data_Wrap_Struct(klass, mark, free, ptr), just set NULL for the "free" pointer. But of course this assumes that the SEGV occurs because of the C-related code, not Ruby-related code, and hopefully the database also does not require special handling during automatic termination. Regards, Bill -- Posted via http://www.ruby-forum.com/.