aboutsummaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2019-05-30 19:37:18 -0400
committerZach Hilman <zachhilman@gmail.com>2019-09-21 21:45:05 -0400
commit0d2e645cb2c09f61a6de95c3f1702ed2a66f15ff (patch)
treeaff7d6e612b689ac429310099e59c485ac8a007b /src/core/core.cpp
parent3ad3191d566cbc8083b990e9835b33d0ab8fe7cb (diff)
core: Initialize cheats after load to avoid VMManager crash
This used to occur due to the VMManager being nullptr at the time cheats were registered (during load, but before it was done). This is bypassed by not accessing the VMManager for offset data until load is complete,
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 67ec8d4b98..fc70394213 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -205,6 +205,11 @@ struct System::Impl {
gpu_core->Start();
cpu_core_manager.StartThreads();
+ // Initialize cheat engine
+ if (cheat_engine) {
+ cheat_engine->Initialize();
+ }
+
// All threads are started, begin main process execution, now that we're in the clear.
main_process->Run(load_parameters->main_thread_priority,
load_parameters->main_thread_stack_size);