haxeui / haxeui-openfl

The OpenFL backend of the HaxeUI framework -
http://haxeui.org
MIT License
42 stars 14 forks source link

HaxeUI crashes on second window #69

Open BombasticTom opened 6 months ago

BombasticTom commented 6 months ago

HaxeUI-OpenFL seems to randomly crash on a 2 window Lime application.

Current Behavior

The software works, it creates two windows, but the program has a habit of randomly crashing after a while of clicking on one of the buttons.

Media

(the video plays twice for an unknown reason)

https://github.com/haxeui/haxeui-openfl/assets/85838311/876ef861-0d23-4b0a-8c2a-2de5d2d298e6

If you have any language translation questions, let me know

Test app / minimal test case

Window Creation Code:

window = stage.application.createWindow({
    title: "KONTROLNA TABLA",
    width: 800,
    height: 720,
    resizable: false,
});
window.stage.color = 0x00000000;

var app:HaxeUIApp = new HaxeUIApp({container: window.stage});

app.ready(function()
{
    app.addComponent(new MainView());
    app.start();
});

Context

Basically, my friend has asked me to program him a game show software where he uses one window for controlling the whole game, and the other window to display all game events. I decided to use HaxeFlixel for the first window as the game screen, and HaxeUI-OpenFL for the second window, as a game controller.

Your Environment

ianharrigan commented 6 months ago

its an interesting concept... i presume openfl by itself is fine with 2 windows? No crashes?

Also, i dont think it will fix your issue, but can you update to git version of haxeui-core and haxeui-openfl?

BombasticTom commented 6 months ago

its an interesting concept... i presume openfl by itself is fine with 2 windows? No crashes?

Yup, I even tried using FlxGame and HaxeUIApp on the same window, and it worked without any crashes

Also, i dont think it will fix your issue, but can you update to git version of haxeui-core and haxeui-openfl?

Sure, I'll update to the git version.

ianharrigan commented 6 months ago

Do you have an example app i can mess with?

BombasticTom commented 6 months ago

I can upload the source code later if it helps

ianharrigan commented 6 months ago

Will defo help - its a very non standard use case, but it would be interesting to see what could be done since it already kinda works anyway

BombasticTom commented 6 months ago

Alright, I have published the source code. Sorry for not doing it earlier, I was busy.

Here's the link: https://github.com/BombasticTom/the-chase-source

If you have any translation questions, let me know and I'll explain what it means.

ianharrigan commented 6 months ago

So i commented out all the timer / sound stuff in PrvaRunda.hx and the app stops crashing - its hard to grep exactly what all those timers are for, but my guess is there is something wrong going on there, ie, i dont think this is really anything to do with haxeui / haxeui-flixel. Ive left the app running for 20 mins with no crashes, and with timers / sound it crashed after about 20-30 seconds.

I would review the logic in there and see if you can piece together what is happening :)

BombasticTom commented 6 months ago

Thank you so much for the help, I'll see what I can do today and let you know if the issue is solved.