From 440c8079362e9852a7b60cc512f3672f8227fb42 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Fri, 6 Nov 2015 16:27:07 -0800 Subject: [PATCH] Fix error state shutdown crash. --- src/xenia/kernel/user_module.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xenia/kernel/user_module.cc b/src/xenia/kernel/user_module.cc index 83b41a882..d38dcec0f 100644 --- a/src/xenia/kernel/user_module.cc +++ b/src/xenia/kernel/user_module.cc @@ -142,12 +142,14 @@ X_STATUS UserModule::LoadFromMemory(const void* addr, const size_t length) { } X_STATUS UserModule::Unload() { - if (module_format_ == kModuleFormatXex && !xex_module()->loaded()) { + if (module_format_ == kModuleFormatXex && + (!processor_module_ || !xex_module()->loaded())) { // Quick abort. return X_STATUS_SUCCESS; } - if (module_format_ == kModuleFormatXex && xex_module()->Unload()) { + if (module_format_ == kModuleFormatXex && processor_module_ && + xex_module()->Unload()) { OnUnload(); return X_STATUS_SUCCESS; }