diff --git a/host/include/interface/platform.h b/host/include/interface/platform.h index 738aebf7..9ad04cf7 100644 --- a/host/include/interface/platform.h +++ b/host/include/interface/platform.h @@ -32,6 +32,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA int app_main(int argc, char * argv[]); bool app_init(); +void app_shutdown(); void app_quit(); // these must be implemented for each OS diff --git a/host/platform/Windows/src/platform.c b/host/platform/Windows/src/platform.c index 4d232835..a4eb094f 100644 --- a/host/platform/Windows/src/platform.c +++ b/host/platform/Windows/src/platform.c @@ -304,11 +304,11 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine shutdown: DestroyMenu(app.trayMenu); - app_quit(); + app_shutdown(); if (!lgJoinThread(thread, &result)) { DEBUG_ERROR("Failed to join the main application thread"); - result = -1; + result = LG_HOST_EXIT_FAILED; } finish: diff --git a/host/src/app.c b/host/src/app.c index 57dbb84c..37ab6271 100644 --- a/host/src/app.c +++ b/host/src/app.c @@ -663,8 +663,13 @@ fail_ivshmem: return exitcode; } +void app_shutdown(void) +{ + app.state = APP_STATE_SHUTDOWN; +} + void app_quit(void) { app.exitcode = LG_HOST_EXIT_USER; - app.state = APP_STATE_SHUTDOWN; + app_shutdown(); }