Skip to content

Commit

Permalink
- let the "abort" button on the network pane of the startup screen do…
Browse files Browse the repository at this point in the history
… a hard exit on Windows.

This merely posted a quit message which did not get properly processed and let the game run into other code with incompletely set up data.
  • Loading branch information
coelckers committed Jun 23, 2022
1 parent 67127e4 commit 124d71a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/common/platform/win32/i_mainwindow.cpp
Expand Up @@ -10,6 +10,7 @@
#include "utf8.h"
#include "v_font.h"
#include "i_net.h"
#include "engineerrors.h"
#include <richedit.h>
#include <shellapi.h>
#include <commctrl.h>
Expand Down Expand Up @@ -264,7 +265,7 @@ static INT_PTR CALLBACK NetStartPaneProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
{
if (msg == WM_COMMAND && HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDCANCEL)
{
PostQuitMessage(0);
PostMessage(hDlg, WM_COMMAND, 1337, 1337);
return TRUE;
}
return FALSE;
Expand Down Expand Up @@ -357,6 +358,11 @@ bool MainWindow::RunMessageLoop(bool (*timer_callback)(void*), void* userdata)
}
else
{
// This must be outside the window function so that the exception does not cross DLL boundaries.
if (msg.message == WM_COMMAND && msg.wParam == 1337 && msg.lParam == 1337)
{
throw CExitEvent(0);
}
if (msg.message == WM_TIMER && msg.hwnd == Window && msg.wParam == 1337)
{
if (timer_callback(userdata))
Expand Down

0 comments on commit 124d71a

Please sign in to comment.