Make rb_define_module_id_under() pin existing modules
Just like rb_define_class_id_under(). Also makes rb_define_module_under() consistent with rb_define_class_under() in the same regard.
This commit is contained in:
parent
d7a844cb08
commit
646131448e
Notes:
git
2021-01-27 09:24:34 +09:00
2
class.c
2
class.c
@ -908,6 +908,8 @@ rb_define_module_id_under(VALUE outer, ID id)
|
|||||||
" (%"PRIsVALUE")",
|
" (%"PRIsVALUE")",
|
||||||
outer, rb_id2str(id), rb_obj_class(module));
|
outer, rb_id2str(id), rb_obj_class(module));
|
||||||
}
|
}
|
||||||
|
/* Module may have been defined in Ruby and not pin-rooted */
|
||||||
|
rb_gc_register_mark_object(module);
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
module = rb_module_new();
|
module = rb_module_new();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user