whb: Fix WHBGfxShutdown when app is in background.

This commit is contained in:
James Benton 2019-11-24 11:06:57 +00:00
parent 188b8b9ebd
commit cd6e74fd17

View File

@ -70,6 +70,9 @@ sDrawingTv = FALSE;
static BOOL
sGpuTimedOut = FALSE;
static BOOL
sGfxHasForeground = TRUE;
static void *
GfxGX2RAlloc(GX2RResourceFlags flags,
uint32_t size,
@ -155,6 +158,8 @@ GfxInitDepthBuffer(GX2DepthBuffer *db,
static uint32_t
GfxProcCallbackAcquired(void *context)
{
sGfxHasForeground = TRUE;
if (!GfxHeapInitMEM1()) {
WHBLogPrintf("%s: GfxHeapInitMEM1 failed", __FUNCTION__);
goto error;
@ -275,6 +280,7 @@ GfxProcCallbackReleased(void *context)
GfxHeapDestroyMEM1();
GfxHeapDestroyForeground();
sGfxHasForeground = FALSE;
return 0;
}
@ -437,7 +443,10 @@ WHBGfxShutdown()
sGpuTimedOut = FALSE;
}
GfxProcCallbackReleased(NULL);
if (sGfxHasForeground) {
GfxProcCallbackReleased(NULL);
}
GX2RSetAllocator(NULL, NULL);
GX2Shutdown();