Fix a crash if the gpu doesn't load.

E.g. for invalid files with multithreading enabled.
This commit is contained in:
Unknown W. Brackets 2013-11-06 07:49:32 -08:00
parent 51995a3d43
commit 82706ef82d

View file

@ -260,8 +260,10 @@ void CPU_RunLoop() {
}
// Let's make sure the gpu has already cleaned up before we start freeing memory.
gpu->FinishEventLoop();
gpu->SyncThread(true);
if (gpu) {
gpu->FinishEventLoop();
gpu->SyncThread(true);
}
CPU_Shutdown();
CPU_SetState(CPU_THREAD_NOT_RUNNING);