3DS - Fix hang on shutdown

This commit is contained in:
Clownacy 2020-10-14 18:40:37 +01:00
parent c50155b1b0
commit e732534e91
2 changed files with 13 additions and 1 deletions

View file

@ -91,7 +91,7 @@ bool Backend_SystemTask(bool active)
{
(void)active;
return aptMainLoop();
return true;
}
void Backend_GetKeyboardState(bool *keyboard_state)

View file

@ -6,6 +6,10 @@
#include <string.h>
#include <string>
#ifdef _3DS
#include <3ds.h>
#endif
#include "WindowsWrapper.h"
#include "Backends/Misc.h"
@ -76,6 +80,14 @@ BOOL Flip_SystemTask(void)
RenderBackend_DrawScreen();
#ifdef _3DS
// This would go in Backend_SystemTask, but that causes a hang
// because of a race condition: aptMainLoop cannot be called
// between C3D_FrameBegin and C3D_FrameEnd
if (!aptMainLoop())
return false;
#endif
if (RestoreSurfaces())
{
RestoreStripper();