Skip to content

Commit 795d1ae

Browse files
committed
testmessage: Don't push the event if "Retry" was chosen.
Otherwise, the message box thread goes back to blocking, but the app's main thread progresses to SDL_WaitThread and won't pump the event queue anymore. On iOS, this means the messagebox won't pop back up (because it uses SDL_RunOnMainThread, which needs the event loop to pump), but it's just bad practice on any platform to stop pumping the event queue for indefinite lengths of time.
1 parent d73fe0b commit 795d1ae

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/testmessage.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,16 @@ static int SDLCALL button_messagebox(void *eventNumber)
9898
}
9999
SDL_Log("Pressed button: %d, %s", button, button == -1 ? "[closed]" : text);
100100

101+
if (button == 2) {
102+
continue;
103+
}
104+
101105
if (eventNumber) {
102106
SDL_Event event;
103107
event.type = (Uint32)(intptr_t)eventNumber;
104108
SDL_PushEvent(&event);
105109
}
106110

107-
if (button == 2) {
108-
continue;
109-
}
110111
return 0;
111112
}
112113
}

0 commit comments

Comments
 (0)