summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'class.c')
-rw-r--r--class.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/class.c b/class.c
index e6fb74816b..bb65ce487f 100644
--- a/class.c
+++ b/class.c
@@ -524,6 +524,7 @@ rb_define_class_id_under(VALUE outer, ID id, VALUE super)
rb_set_class_path_string(klass, outer, rb_id2str(id));
rb_const_set(outer, id, klass);
rb_class_inherited(super, klass);
+ rb_gc_register_mark_object(klass);
return klass;
}
@@ -590,6 +591,7 @@ rb_define_module_id_under(VALUE outer, ID id)
module = rb_define_module_id(id);
rb_const_set(outer, id, module);
rb_set_class_path_string(module, outer, rb_id2str(id));
+ rb_gc_register_mark_object(module);
return module;
}