Fix gc issue

This commit is contained in:
2026-05-19 16:50:35 +01:00
parent 7bdb74e099
commit 1a337608f3
2 changed files with 10 additions and 6 deletions
+1 -4
View File
@@ -27,7 +27,6 @@ struct Element {
virtual Vec2<float> size(Window *window) = 0;
void click() {
printf("Running click handler\n");
on_click.call();
}
};
@@ -78,8 +77,7 @@ struct EText : Element {
EText(Localization::Key key, uint64_t font_id, Color color, mrb_value params)
: Element(Type::TEXT), key(key), font_id(font_id), color(color), params(params) {
if (!mrb_nil_p(params))
mrb_gc_protect(Ruby::mrb, params);
mrb_gc_register(Ruby::mrb, params);
font_pool.use(font_id);
}
@@ -170,7 +168,6 @@ struct Scene {
void update_scene(uint64_t delta_time) {
if (!mrb_nil_p(update.proc)) {
mrb_value dt_val = mrb_int_value(Ruby::mrb, delta_time);
printf("running: update, dt: %lu\n", delta_time);
update.call(1, &dt_val);
}
}