mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 21:37:42 -07:00
libui/windows: don't explode if setWindowText() fails. fixes random crash when closing window.
also add extra safety, can't hurt.
This commit is contained in:
parent
2e82a4f26a
commit
e4e8d775c0
@ -29,8 +29,7 @@ WCHAR *windowText(HWND hwnd)
|
||||
|
||||
void setWindowText(HWND hwnd, WCHAR *wtext)
|
||||
{
|
||||
if (SetWindowTextW(hwnd, wtext) == 0)
|
||||
logLastError(L"error setting window text");
|
||||
SetWindowTextW(hwnd, wtext);
|
||||
}
|
||||
|
||||
void uiFreeText(char *text)
|
||||
|
@ -755,6 +755,12 @@ void TryLoadROM(char* file, int prevstatus)
|
||||
|
||||
int OnCloseWindow(uiWindow* window, void* blarg)
|
||||
{
|
||||
if (RunningSomething)
|
||||
{
|
||||
EmuRunning = 2;
|
||||
while (EmuStatus != 2);
|
||||
}
|
||||
|
||||
uiQuit();
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user