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)
|
void setWindowText(HWND hwnd, WCHAR *wtext)
|
||||||
{
|
{
|
||||||
if (SetWindowTextW(hwnd, wtext) == 0)
|
SetWindowTextW(hwnd, wtext);
|
||||||
logLastError(L"error setting window text");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiFreeText(char *text)
|
void uiFreeText(char *text)
|
||||||
|
|
|
@ -755,6 +755,12 @@ void TryLoadROM(char* file, int prevstatus)
|
||||||
|
|
||||||
int OnCloseWindow(uiWindow* window, void* blarg)
|
int OnCloseWindow(uiWindow* window, void* blarg)
|
||||||
{
|
{
|
||||||
|
if (RunningSomething)
|
||||||
|
{
|
||||||
|
EmuRunning = 2;
|
||||||
|
while (EmuStatus != 2);
|
||||||
|
}
|
||||||
|
|
||||||
uiQuit();
|
uiQuit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue