Skip to content

Commit aefca5e

Browse files
dkosmariDaniel K. O. (dkosmari)
authored andcommitted
Wii U: Fix ProcUI cleanup for shutdown. (#117)
Co-authored-by: Daniel K. O. (dkosmari) <none@none>
1 parent 3e4393a commit aefca5e

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/video/wiiu/SDL_wiiuvideo.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,9 @@ static void WIIU_VideoQuit(_THIS)
292292
WIIU_VideoData *videodata = (WIIU_VideoData *) _this->driverdata;
293293

294294
if (videodata->handleProcUI) {
295-
// Put ProcUI into EXIT/shutdown state if user stopped processing events
295+
// Put ProcUI into EXIT state if user stopped processing events
296296
// before SDL_QUIT was generated.
297-
if (ProcUIIsRunning() && !ProcUIInShutdown()) {
297+
if (ProcUIIsRunning() && !videodata->exitingProcUI) {
298298
SDL_bool procui_running = SDL_TRUE;
299299
SYSLaunchMenu();
300300
while (procui_running) {
@@ -366,15 +366,15 @@ static void WIIU_PumpEvents(_THIS)
366366
{
367367
WIIU_VideoData *videodata = (WIIU_VideoData *) _this->driverdata;
368368

369-
if (videodata->handleProcUI && !ProcUIInShutdown()) {
369+
if (videodata->handleProcUI) {
370370
if (videodata->enteringBackground) {
371371
// The previous ProcUIProcessMessages() received a
372372
// PROCUI_STATUS_RELEASE_FOREGROUND.
373373
videodata->enteringBackground = SDL_FALSE;
374374
ProcUIDrawDoneRelease();
375375
}
376376

377-
if (ProcUIIsRunning() && !ProcUIInShutdown()) {
377+
if (ProcUIIsRunning() && !videodata->exitingProcUI) {
378378
ProcUIStatus status = ProcUIProcessMessages(TRUE);
379379
switch (status) {
380380
case PROCUI_STATUS_IN_FOREGROUND:
@@ -383,7 +383,7 @@ static void WIIU_PumpEvents(_THIS)
383383
case PROCUI_STATUS_IN_BACKGROUND:
384384
break;
385385
case PROCUI_STATUS_RELEASE_FOREGROUND: {
386-
SDL_Window* window = _this->windows;
386+
SDL_Window *window = _this->windows;
387387
while (window) {
388388
// No longer in foreground, window is no longer
389389
// visible.
@@ -400,6 +400,7 @@ static void WIIU_PumpEvents(_THIS)
400400
break;
401401
}
402402
case PROCUI_STATUS_EXITING:
403+
videodata->exitingProcUI = SDL_TRUE;
403404
SDL_SendQuit();
404405
break;
405406
}

src/video/wiiu/SDL_wiiuvideo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ struct WIIU_VideoData
3939

4040
SDL_bool hasForeground;
4141
SDL_bool enteringBackground;
42+
// indicate if ProcUI received PROCUI_STATUS_EXITING
43+
SDL_bool exitingProcUI;
4244

4345
void *commandBufferPool;
4446

0 commit comments

Comments
 (0)