mirror of https://github.com/libsdl-org/SDL.git
main: Check for SDL_AddEventWatch failure, now that it can report it.
This commit is contained in:
parent
7e445da569
commit
019468dc59
|
|
@ -67,7 +67,11 @@ int SDL_InitMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_
|
||||||
total_pending_events++;
|
total_pending_events++;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_AddEventWatch(EventWatcher, NULL); // !!! FIXME: this should really return an error.
|
if (SDL_AddEventWatch(EventWatcher, NULL) == -1) {
|
||||||
|
SDL_free(pending_events);
|
||||||
|
SDL_AtomicSet(&apprc, -1);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < total_pending_events; i++) {
|
for (int i = 0; i < total_pending_events; i++) {
|
||||||
SDL_PushEvent(&pending_events[i]);
|
SDL_PushEvent(&pending_events[i]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue