From: MenTaLguY Date: 2007-06-20T02:13:34+09:00 Subject: Re: Problem wrapping the C++ STL Incidentally, I did want to throw in a note to be very, very careful about exceptions when wrapping C++ code as a Ruby extension. It's necessary to catch and wrap/unwrap exceptions at all C++/C boundaries, since otherwise, Ruby cleanup (ensure, rescue, etc...) will be skipped when C++ exceptions unwind the stack (potentially trashing the interpreter), and C++ cleanup (destructors for objects in automatic storage, catch, etc...) will get skipped when Ruby exceptions unwind the stack. Also, on some architectures, a C++ exception tearing down a C stack frame is by itself enough to cause badness. boost.python takes care of all this for writing Python extensions in C++, but sadly there's not a maintained Ruby equivalent. -mental