[macruby-changes] [116] MacRuby/trunk/objc.m

source_changes at macosforge.org source_changes at macosforge.org
Fri Mar 21 11:56:15 PDT 2008


Revision: 116
          http://trac.macosforge.org/projects/ruby/changeset/116
Author:   lsansonetti at apple.com
Date:     2008-03-21 11:56:14 -0700 (Fri, 21 Mar 2008)

Log Message:
-----------
fixed memory crasher, by making sure the constant magic cookies will not be collected

Modified Paths:
--------------
    MacRuby/trunk/objc.m

Modified: MacRuby/trunk/objc.m
===================================================================
--- MacRuby/trunk/objc.m	2008-03-21 18:02:11 UTC (rev 115)
+++ MacRuby/trunk/objc.m	2008-03-21 18:56:14 UTC (rev 116)
@@ -2775,8 +2775,10 @@
     rb_objc_retain(bs_inf_prot_imethods = st_init_numtable());
     rb_objc_retain(bs_cftypes = st_init_strtable());
 
-    bs_const_magic_cookie = rb_str_new2("bs_const_magic_cookie");
-    rb_objc_class_magic_cookie = rb_str_new2("rb_objc_class_magic_cookie");
+    rb_objc_retain(
+	bs_const_magic_cookie = rb_str_new2("bs_const_magic_cookie"));
+    rb_objc_retain(
+	rb_objc_class_magic_cookie = rb_str_new2("rb_objc_class_magic_cookie"));
 
     rb_cBoxed = rb_define_class("Boxed", rb_cObject);
     rb_define_singleton_method(rb_cBoxed, "objc_type", rb_boxed_objc_type, 0);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080321/51dc0f0f/attachment.html 


More information about the macruby-changes mailing list