From d06f563bfe5f7bd5daeeebb5529df7bbb299baf3 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Mon, 21 Jun 2021 14:44:07 +1000 Subject: [PATCH] [windows] Fix application shutdown --- v2/internal/ffenestri/ffenestri_windows.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/v2/internal/ffenestri/ffenestri_windows.cpp b/v2/internal/ffenestri/ffenestri_windows.cpp index 4e4ecf7fc..ce33292eb 100644 --- a/v2/internal/ffenestri/ffenestri_windows.cpp +++ b/v2/internal/ffenestri/ffenestri_windows.cpp @@ -140,7 +140,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_DESTROY: { - DestroyApplication(app); + PostQuitMessage(0); break; } case WM_SIZE: { @@ -551,9 +551,6 @@ void Run(struct Application* app, int argc, char **argv) { } } -void DestroyApplication(struct Application* app) { - PostQuitMessage(0); -} void SetDebug(struct Application* app, int flag) { debug = flag; } @@ -714,7 +711,9 @@ void SetPosition(struct Application* app, int x, int y) { } void Quit(struct Application* app) { - DestroyWindow(app->window); + ON_MAIN_THREAD( + DestroyWindow(app->window); + ); }