summaryrefslogtreecommitdiffstats
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2015-12-30 00:03:08 +0100
committerLioncash <mathew1800@gmail.com>2015-12-30 00:03:08 +0100
commitcee8df6ff018ea6a851f012fa1c0eea758c758b0 (patch)
tree8fa1c00d82331054c4c6d4d0a331faec196efff9 /src/core/core.cpp
parentMerge pull request #1300 from Subv/arbitrateaddress (diff)
downloadyuzu-cee8df6ff018ea6a851f012fa1c0eea758c758b0.tar
yuzu-cee8df6ff018ea6a851f012fa1c0eea758c758b0.tar.gz
yuzu-cee8df6ff018ea6a851f012fa1c0eea758c758b0.tar.bz2
yuzu-cee8df6ff018ea6a851f012fa1c0eea758c758b0.tar.lz
yuzu-cee8df6ff018ea6a851f012fa1c0eea758c758b0.tar.xz
yuzu-cee8df6ff018ea6a851f012fa1c0eea758c758b0.tar.zst
yuzu-cee8df6ff018ea6a851f012fa1c0eea758c758b0.zip
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 219b03af4..453c7162d 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -2,6 +2,9 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include <memory>
+
+#include "common/make_unique.h"
#include "common/logging/log.h"
#include "core/core.h"
@@ -17,8 +20,8 @@
namespace Core {
-ARM_Interface* g_app_core = nullptr; ///< ARM11 application core
-ARM_Interface* g_sys_core = nullptr; ///< ARM11 system (OS) core
+std::unique_ptr<ARM_Interface> g_app_core; ///< ARM11 application core
+std::unique_ptr<ARM_Interface> g_sys_core; ///< ARM11 system (OS) core
/// Run the core CPU loop
void RunLoop(int tight_loop) {
@@ -71,16 +74,16 @@ void Stop() {
/// Initialize the core
int Init() {
- g_sys_core = new ARM_DynCom(USER32MODE);
- g_app_core = new ARM_DynCom(USER32MODE);
+ g_sys_core = Common::make_unique<ARM_DynCom>(USER32MODE);
+ g_app_core = Common::make_unique<ARM_DynCom>(USER32MODE);
LOG_DEBUG(Core, "Initialized OK");
return 0;
}
void Shutdown() {
- delete g_app_core;
- delete g_sys_core;
+ g_app_core.reset();
+ g_sys_core.reset();
LOG_DEBUG(Core, "Shutdown OK");
}