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:
StapleButter 2017-12-17 02:11:28 +01:00
parent 2e82a4f26a
commit e4e8d775c0
2 changed files with 7 additions and 2 deletions

View File

@ -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)

View File

@ -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;
}