ObjectSpace.each_object should filter out internal (i.e. obj->c == NULL) objects; ref #2429

parent f9076230
......@@ -126,6 +126,9 @@ os_each_object_cb(mrb_state *mrb, struct RBasic *obj, void *ud)
return;
}
/* filter half baked (or internal) objects */
if (!obj->c) return;
/* filter class kind if target module defined */
if (d->target_module && !mrb_obj_is_kind_of(mrb, mrb_obj_value(obj), d->target_module)) {
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment