wasm: don’t exit on clean return from main()
Qt 6 uses Emcripten’s default of not exiting the runtime when main() exits. Make qtloader not transition to the “Exited” state when main() exits with code 0, since this would hide the app canvas. (The app state tracking code in qtloader is by now outdated, and should be revisited.) Pick-to: 6.3 Change-Id: Ib47898f1dd93d87b2675f20cd39f96ac3cb681a7 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This commit is contained in:
parent
9b096e8cb8
commit
08ea8aaa8b
@ -407,6 +407,12 @@ function QtLoader(config)
|
||||
setStatus("Exited");
|
||||
};
|
||||
self.moduleConfig.quit = self.moduleConfig.quit || function(code, exception) {
|
||||
|
||||
// Emscripten (and Qt) supports exiting from main() while keeping the app
|
||||
// running. Don't transition into the "Exited" state for clean exits.
|
||||
if (code == 0)
|
||||
return;
|
||||
|
||||
if (exception.name == "ExitStatus") {
|
||||
// Clean exit with code
|
||||
publicAPI.exitText = undefined
|
||||
|
Loading…
x
Reference in New Issue
Block a user