trynna fix click handler being garbage collected

This commit is contained in:
2026-05-19 13:33:02 +01:00
parent a692bfb2b3
commit 7bdb74e099
5 changed files with 38 additions and 12 deletions
+3 -2
View File
@@ -27,8 +27,8 @@ struct Element {
virtual Vec2<float> size(Window *window) = 0;
void click() {
if (!mrb_nil_p(on_click.proc))
on_click.call();
printf("Running click handler\n");
on_click.call();
}
};
@@ -170,6 +170,7 @@ 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);
}
}