On Thursday 29 July 2004 13:11, Tilman Sauerbeck wrote: > > I know I can work around this by using rb_global_variable() to tell the > GC not to claim the object, but this kinda sucks since the object will > never be freed :( > > So, my question is: how do I prevent the Result object from being > claimed by the GC without using rb_global_variable's? If this object is a VALUE variable in your C code, you should declare it this way: volatile VALUE result = Qnil; Adding volatile allows the GC to see the object on the C stack. This means that so long as your C code holds it in that variable, it will never go away. Sean O'Dell