Skip to content
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

Mainloop terminating unintentionally #10682

Closed
ZwodahS opened this issue Apr 16, 2022 · 4 comments · Fixed by #11028
Closed

Mainloop terminating unintentionally #10682

ZwodahS opened this issue Apr 16, 2022 · 4 comments · Fixed by #11028

Comments

@ZwodahS
Copy link

ZwodahS commented Apr 16, 2022

This issue is from Heaps originally, and as requested, is moved here.

Original issues HeapsIO/heaps#1068

---- copied from heaps issue
minimum code https://github.com/ZwodahS/heaps-sound-bug

OS : Mac
heaps version: 57c1bd34779193636562621faca5a875b2113923
haxe: 4.2.4

SoundManager set isBlocking to false.
https://github.com/HeapsIO/heaps/blob/master/hxd/snd/Manager.hx#L151

Main loop cancel the event and only adds it back when there is a blocking event.
https://github.com/HaxeFoundation/haxe/blob/development/std/haxe/MainLoop.hx#L81-L89
https://github.com/HaxeFoundation/haxe/blob/development/std/haxe/MainLoop.hx#L124

This is fine when live update is set to true hxd.res.Resource.LIVE_UPDATE = true; (suspect that the live update created a blocking main event) or when you have mainEvent elsewhere.

with that, there is 2 solutions that I found that works
https://github.com/ZwodahS/heaps-sound-bug/blob/main/App.hx#L4-L5

However, I am curious as to what is the best way to handle this, and if this is considered a bug.

@ncannasse
Copy link
Member

I think in Browser JS, MainLoop should never reall "exit" because you might have some other source of events (like in our case).

@ncannasse
Copy link
Member

Ping @RealyUniqueName : this used to work before MainLoop changes in ~4.2

@Simn
Copy link
Member

Simn commented May 15, 2022

The change causes some threads tests to fail:

cases.TestMainLoop
  testNewAction_immediately: ERROR O
    missed async calls: 1
  testWorksInStaticInits_issue10114: ERROR O
    missed async calls: 1

@Simn
Copy link
Member

Simn commented May 25, 2022

@RealyUniqueName @ncannasse I would appreciate if you could sort out this failing test because I'm not familiar with this code at all. This currently makes our CI red.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants