From: ts Date: 2006-03-13T22:05:56+09:00 Subject: Re: Extension module: Why does object get GCed? >>>>> "p" == pseudoman4 writes: p> void BindToRubyVariable(someObject* native, char* variableName) { p> VALUE klass = get_ruby_class_object_from_somewhere p> VALUE ruby_obj = Data_Wrap_Struct(klass, 0, 0, native); ^^^^^^^^^^^^^^ p> rb_define_variable(variableName, &ruby_obj); ^^^^^^^^^ at the end of the function, this address is not valid and probably will not make reference to the new created object p> } Guy Decoux