From c3226f435ce4b336ae6ae6e2a7a39bbaf1951663 Mon Sep 17 00:00:00 2001 From: Arisotura Date: Mon, 20 May 2024 00:19:22 +0200 Subject: [PATCH] make it actually work, somewhat still a lot more crap to fix --- src/frontend/qt_sdl/EmuInstance.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/frontend/qt_sdl/EmuInstance.cpp b/src/frontend/qt_sdl/EmuInstance.cpp index 4b33af1f..ab0b7d52 100644 --- a/src/frontend/qt_sdl/EmuInstance.cpp +++ b/src/frontend/qt_sdl/EmuInstance.cpp @@ -66,6 +66,11 @@ EmuInstance::EmuInstance(int inst) : instanceID(inst), globalCfg(Config::GetGlobalTable()), localCfg(Config::GetLocalTable(inst)) { + cheatFile = nullptr; + + nds = nullptr; + updateConsole(nullptr, nullptr); + audioInit(); emuThread = new EmuThread(this); @@ -1022,10 +1027,10 @@ bool EmuInstance::updateConsole(UpdateConsoleNDSArgs&& _ndsargs, UpdateConsoleGB } - if (consoletype != nds->ConsoleType) + if ((!nds) || (consoletype != nds->ConsoleType)) { NDS::Current = nullptr; - delete nds; + if (nds) delete nds; if (consoletype == 1) nds = new DSi(std::move(dsiargs.value()));