Просмотр исходного кода

core: Free AppLoader on shutdown to release file (#2558)

Fixes #2455
Yuri Kunde Schlesner 9 лет назад
Родитель
Сommit
da6a40e3d1
1 измененных файлов с 2 добавлено и 9 удалено
  1. 2 9
      src/core/core.cpp

+ 2 - 9
src/core/core.cpp

@@ -67,10 +67,6 @@ System::ResultStatus System::SingleStep() {
 }
 
 System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& filepath) {
-    if (app_loader) {
-        app_loader.reset();
-    }
-
     app_loader = Loader::GetLoader(filepath);
 
     if (!app_loader) {
@@ -123,10 +119,6 @@ void System::Reschedule() {
 }
 
 System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
-    if (cpu_core) {
-        cpu_core.reset();
-    }
-
     Memory::Init();
 
     if (Settings::values.use_cpu_jit) {
@@ -159,7 +151,8 @@ void System::Shutdown() {
     Kernel::Shutdown();
     HW::Shutdown();
     CoreTiming::Shutdown();
-    cpu_core.reset();
+    cpu_core = nullptr;
+    app_loader = nullptr;
 
     LOG_DEBUG(Core, "Shutdown OK");
 }