Laurent Sansonetti
lsans****@apple*****
Thu Nov 16 02:05:54 JST 2006
Oops, I also forgot to tell you about that, I fixed this bug in the unstable branch several weeks ago when switching to libffi... ごめんあさい! Laurent On Nov 15, 2006, at 2:27 PM, kimura wataru wrote: > Hi, > > I think missing retain for result of functions occurs this error. > The following diff is a patch to trunk. > > === framework/src/objc/cocoa/init_cocoa.m > ================================================================== > --- framework/src/objc/cocoa/init_cocoa.m (revision 1360) > +++ framework/src/objc/cocoa/init_cocoa.m (local) > @@ -9,6 +9,7 @@ > #import <Foundation/NSException.h> > #import <Foundation/NSString.h> > #import "osx_ruby.h" > +#import "cls_objcid.h" > #import "ocdata_conv.h" > > static VALUE > @@ -65,6 +66,11 @@ > if (pool) [pool release]; > rb_raise(_ocdataconv_err_class(), "%s - result cannot convert > to rbobj.", fname); > } > + if (!NIL_P(rbresult) && rb_obj_is_kind_of(rbresult, > objid_s_class()) == Qtrue > + && !OBJCID_DATA_PTR(rbresult)->retained) { > + [OBJCID_ID(rbresult) retain]; > + OBJCID_DATA_PTR(rbresult)->retained = YES; > + } > return rbresult; > } > > > > On Wed, 15 Nov 2006 16:06:08 +0900, Fujimoto Hisa wrote: >> hi >> >> I found a problem on src-trunk (0.5.0preview6 r1217) when writing an >> app with CoreData. the following code make Bus Error: >> >> require 'osx/cocoa' >> # require 'osx/coredata' # this line seems no effect about the >> issue >> include OSX >> paths = NSSearchPathForDirectoriesInDomains >> (NSApplicationSupportDirectory, >> NSUserDomainMask, >> true) >> >> This code was just translated from an objective-c source which is >> generated by Xcode CoreData application template. >> >> It works fine on 0.4.3d2. Sorry I don't check why it's not work on >> trunk yet. >> -- >> hisa >> >> _______________________________________________ >> Rubycocoa-devel mailing list >> Rubyc****@lists***** >> http://lists.sourceforge.jp/mailman/listinfo/rubycocoa-devel > _______________________________________________ > Rubycocoa-devel mailing list > Rubyc****@lists***** > http://lists.sourceforge.jp/mailman/listinfo/rubycocoa-devel