trynna fix click handler being garbage collected
This commit is contained in:
+3
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user