Make the workqueue slightly safer. Put g_gameInfoCache on the heap.

Cherry-picked from #8592
This commit is contained in:
Henrik Rydgard committed 2016-02-28 12:39:47 +01:00
1 parent 5f761c346b
commit da1a04be8d
18 files changed
+73 -64

No files matched your search

+5 -7
View File
@@ -486,8 +486,6 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
if (!boot_filename.empty() && stateToLoad != NULL)
SaveState::Load(stateToLoad);
g_gameInfoCache.Init();
screenManager = new ScreenManager();
if (skipLogo) {
screenManager->switchScreen(new EmuScreen(boot_filename));
@@ -596,6 +594,8 @@ void NativeInitGraphics(GraphicsContext *graphicsContext) {
winAudioBackend = CreateAudioBackend((AudioBackendType)g_Config.iAudioBackend);
winAudioBackend->Init(MainWindow::GetHWND(), &Win32Mix, 44100);
#endif
g_gameInfoCache = new GameInfoCache();
}
void NativeShutdownGraphics() {
@@ -606,7 +606,8 @@ void NativeShutdownGraphics() {
screenManager->deviceLost();
g_gameInfoCache.Clear();
delete g_gameInfoCache;
g_gameInfoCache = nullptr;
uiTexture->Release();
@@ -764,13 +765,12 @@ void NativeUpdate(InputState &input) {
}
void NativeDeviceLost() {
g_gameInfoCache.Clear();
// g_gameInfoCache.Clear();
screenManager->deviceLost();
if (GetGPUBackend() == GPUBackend::OPENGL) {
gl_lost();
}
// Should dirty EVERYTHING
}
bool NativeIsAtTopLevel() {
@@ -933,8 +933,6 @@ void NativeShutdown() {
delete screenManager;
screenManager = 0;
g_gameInfoCache.Shutdown();
delete host;
host = 0;
g_Config.Save();