Skip to content

Crash calling canvas.destroy_children() #58

@josuigoa

Description

@josuigoa

Hi!

I've set the empty_luxe project and called canvas.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:

macro public function emit( ethis : Expr, args:Array<Expr> ) {
    return macro {
        var _idx = 0;
        trace( 'out.ethis: '+$ethis );
        var _count = $ethis.listeners.length;
        trace( '_count: ' + _count );
        while(_idx < _count) {
            trace( 'while.0.in.ethis: '+$ethis );
            var fn = $ethis.listeners[_idx];
            if(fn != null) {
                fn($a{args});
            }
            _idx++;
        }

        while(_count > 0) {
            trace( 'while.1.in.ethis: '+$ethis );
            var fn = $ethis.listeners[_count-1];
            if(fn == null) $ethis.listeners.splice(_count-1, 1);
            _count--;
        }
    }
} //emit
Signal.hx::51   out.ethis: { listeners : [<function>,<function>] }  mint_luxe_empty.js:5140:2
Signal.hx::53   _count: 2  mint_luxe_empty.js:5140:2
Signal.hx::55   while.0.in.ethis: { listeners : [<function>,<function>] } mint_luxe_empty.js:5140:2
Signal.hx::64   while.1.in.ethis: { listeners : [null,null] }  mint_luxe_empty.js:5140:2
Signal.hx::64   while.1.in.ethis: { listeners : [null]}  mint_luxe_empty.js:5140:2
Signal.hx::64   while.1.in.ethis: null  mint_luxe_empty.js:5140:2
TypeError: this.onmouseup is null[Learn More]  mint_luxe_empty.js:527:8
   mint_Control.prototype.mouseup http://localhost:40404/mint_luxe_empty.js:527:8
   mint_focus_Focus.prototype.mouseup http://localhost:40404/mint_luxe_empty.js:15201:27
   $bind/f http://localhost:40404/mint_luxe_empty.js:28157:233
   mint_Canvas.prototype<.mouseup http://localhost:40404/mint_luxe_empty.js:1162:19
   AutoCanvas.prototype<.conv_mouseup http://localhost:40404/mint_luxe_empty.js:1450:3
   $bind/f http://localhost:40404/mint_luxe_empty.js:28157:233
   luxe_Emitter.prototype.emit http://localhost:40404/mint_luxe_empty.js:3887:5
   luxe_Input.prototype.onmouseup http://localhost:40404/mint_luxe_empty.js:6363:3
   luxe_Engine.prototype<.onmouseup http://localhost:40404/mint_luxe_empty.js:5957:3
   snow_systems_input_Input.prototype.dispatch_mouse_up_event http://localhost:40404/mint_luxe_empty.js:26892:3
   snow_core_web_Runtime.prototype.setup_events/<

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions