From: Jan Bernhardt Date: 2003-05-15T06:47:54+09:00 Subject: Re: Embedding/GC/heap corruption problem On Wed, 14 May 2003 23:42:34 +0200, Simon Strandgaard wrote: >> I used to do that, but during experimentation I removed the protection >> wrapper. But of course you're right - I should protect the function call. > > OK. > > Maybe the 'message' variable hasn't been GC registered correct. > Try swap the line containing rb_global_variable() with the > line containing rb_eval_string("Message.new"); > > > void messages_init() { > message = rb_eval_string("Message.new"); > rb_gc_register_address(&message); > args = rb_iv_get(message, "@args"); > message_registry = rb_eval_string("MessageRegistry.instance"); > } > Unfortunately this did not help either. - Jan.