You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A debug build doesn't exit when run without a debugger #3
A program built with -debug and hxcpp-debug-server never exits when it runs without a debugger.
When connect() fails at startup, waitForAttach() starts a haxe.Timer that runs every 500 ms on the main thread, so that a debugger attaching later can be handled there. The timer keeps the main event loop alive, so the program carries on after main returns.
Seen with Haxe 4.3.7 and the Haxe 5 preview: timeout 5 ./bin/cpp/Main-debug prints the program's output and is then killed after 5 seconds.
This is upstream's code, from before this fork. It doesn't affect sessions started from a debugger, where connect() succeeds. Ways to fix it:
an event that doesn't keep the loop alive (haxe.MainLoop.add(...) with isBlocking = false on Haxe 4; Haxe 5's event loop needs checking)
waiting for an attach only when asked to, through an environment variable or a define
Activity
hxcpp-debug-server: a debug build run without a debugger exits