From: Michael Bruschkewitz Date: 2003-03-17T04:39:39+09:00 Subject: Re: method call on terminated object [W2k,1.6.8} In article <200303141523.h2EFNbeU010813 @sharui.nakada.kanuma.tochigi.jp>, nobu.nokada@softhome.net says... > Hi, > > At Fri, 14 Mar 2003 23:21:26 +0900, > Michael Bruschkewitz wrote: > > Under which circumstances is an String "terminated"? > Bug. Neccessary feed for small birds. > > > conn.read calls the following function from an own extension: > > VALUE TCP_Read(VALUE self, VALUE maxL) { > > CRbTcp* p; Data_Get_Struct(self, CRbTcp, p); > > int ml = NUM2INT(maxL); > > std::string data; > > try { data=p->Read(ml); } > > catch(CRbException & e) { > > ext_raise(self,e.str(),__FILE__,__LINE__); } > > return rb_str_new(data.data(),data.size()); > > } > > Perhaps, you should check if you mark ruby objects properly. Just to be sure, for my problem: class TC ; def initialize ; @s = '' ; end ; end $tc = Testcase.new # from here, tc.s should be valid (and never be terminated) until ... $tc = nil # ... here (after next GC)? Is it possible $tc is not marked because it is assigned inside tc1.rb here: load 'tc1.rb' # tc1.rb: $tc = TC.new If I do not hold any references to Ruby objects inside my C++-classes, do I still need to handle the mark-pass of GC? (rather, C++ objects are held inside TC-member variables) I will track down this bug tomorrow (it's now Sun 8:15pm here), any hints are appreciated. Regards, Michael B.