From: jglueck@... (=?ISO-8859-1?Q?Bernhard_Gl=FCck?=) Date: 2001-09-11T21:19:18+09:00 Subject: [ruby-talk:21076] Re: Calling member methods from C++ Hm, I fixed the problem ... in my C++ method for calling a ruby object method it was like this: The VALUE val ist the class instance VALUE and LogInfo(("")) Is a debug output routine... I was outputting: LogInfo(("Calling ruby object: %s::%s",rb_class2name( val ),(const char *)callString ) ); for debugging purposes ( to see what object is called with what method etc ) On the 28th call to rb_class2name the program crashes.... When i remove this debug statement ( or just the rb_class2name ) everything works smooth as hell... Any clues ? Here is the complete code: void Message::SendToScript( VALUE val ) { guard( Message::SendToScript ); String callString = "On"; callString += m_msg; // Generated for the method ID callId = rb_intern( callString.Get() ); // Now create the parameter array for the call... Array args; LogInfo(("Calling ruby object: %s::%s",rb_class2name( val ),(const char *)callString ) ); if ( rb_respond_to( val,callId ) ) { s_rubyCounter ++; // And make the script call LogInfo(("Rubycall: %u",s_rubyCounter)); rb_funcall2( val,callId,args.Size(),args.Begin() ); } unguard(); }