-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash calling canvas.destroy_children() #58
Comments
destroying a control should destroy itself and all it's listeners so that part is intended, but it seems that the focus model isn't aware of the change. i.e to me it seems the issue comes from It's interesting because it should assert if destroyed right above the I'll have a closer look at it! |
Also, I can't get it to crash :C import luxe.Input;
import luxe.Color;
import luxe.Vector;
import mint.Control;
import mint.types.Types;
import mint.render.luxe.*;
import mint.layout.margins.Margins;
import mint.focus.Focus;
import AutoCanvas;
class Main extends luxe.Game {
var focus: Focus;
var layout: Margins;
var canvas: AutoCanvas;
var rendering: LuxeMintRender;
override function config(config:luxe.GameConfig) {
return config;
} //config
override function ready() {
rendering = new LuxeMintRender();
layout = new Margins();
var _scale = Luxe.screen.device_pixel_ratio;
canvas = new AutoCanvas({
name:'canvas',
rendering: rendering,
options: { color:new Color(1,1,1,0) },
x: 0, y:0, scale:_scale, w: Luxe.screen.w/_scale, h: Luxe.screen.h/_scale
});
focus = new Focus(canvas);
canvas.auto_listen();
//optional!
new mint.Button({
parent: canvas,
name: 'button',
x: 90, y: 40, w: 60, h: 32,
text: 'mint',
text_size: 14,
options: { label: { color:new Color().rgb(0x9dca63) } },
onclick: function(e,c) { canvas.destroy_children(); }
});
} //ready
override function onkeyup( e:luxe.KeyEvent ) {
if(e.keycode == Key.escape) {
Luxe.shutdown();
}
} //onkeyup
} //Main |
I would say that's the code I've tried, but I'm not on the computer and I can't look. |
yep! I copy/pasted the code above in empty_luxe and it crashes. I'm on Window 10, tried in Firefox Developer Edition, Chrome and Windows |
Hi!
I've set the
empty_luxe
project and calledcanvas.destroy_children()
here. When I click the button, the app crashes.It seems that
onmouseup
is set to null in the middle of the emit function. Maybe it is set to null in some of the listeners?This is how I've traced the function and this is the result:
The text was updated successfully, but these errors were encountered: