Revision
116
Author
lsansonetti@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

Diff

Modified: MacRuby/trunk/objc.m (115 => 116)


--- 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);