summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMerryMage <MerryMage@users.noreply.github.com>2016-03-15 03:59:14 +0100
committerMerryMage <MerryMage@users.noreply.github.com>2016-03-15 04:16:54 +0100
commit317e795d353f5f0f709a8b99f7f1d28d2820fa1d (patch)
treef4f643f83e52a0043b8ffd1b9d43336ae2bc92a3 /src
parentMerge pull request #1409 from JamePeng/Reorganize-NDM (diff)
downloadyuzu-317e795d353f5f0f709a8b99f7f1d28d2820fa1d.tar
yuzu-317e795d353f5f0f709a8b99f7f1d28d2820fa1d.tar.gz
yuzu-317e795d353f5f0f709a8b99f7f1d28d2820fa1d.tar.bz2
yuzu-317e795d353f5f0f709a8b99f7f1d28d2820fa1d.tar.lz
yuzu-317e795d353f5f0f709a8b99f7f1d28d2820fa1d.tar.xz
yuzu-317e795d353f5f0f709a8b99f7f1d28d2820fa1d.tar.zst
yuzu-317e795d353f5f0f709a8b99f7f1d28d2820fa1d.zip
Diffstat (limited to 'src')
-rw-r--r--src/citra/citra.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp
index 415b98a05..40e40f192 100644
--- a/src/citra/citra.cpp
+++ b/src/citra/citra.cpp
@@ -19,6 +19,8 @@
#include "common/logging/log.h"
#include "common/logging/backend.h"
#include "common/logging/filter.h"
+#include "common/make_unique.h"
+#include "common/scope_exit.h"
#include "core/settings.h"
#include "core/system.h"
@@ -64,6 +66,7 @@ int main(int argc, char **argv) {
Log::SetFilter(&log_filter);
MicroProfileOnThreadCreate("EmuThread");
+ SCOPE_EXIT({ MicroProfileShutdown(); });
if (boot_filename.empty()) {
LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified");
@@ -76,12 +79,13 @@ int main(int argc, char **argv) {
GDBStub::ToggleServer(Settings::values.use_gdbstub);
GDBStub::SetServerPort(static_cast<u32>(Settings::values.gdbstub_port));
- EmuWindow_SDL2* emu_window = new EmuWindow_SDL2;
+ std::unique_ptr<EmuWindow_SDL2> emu_window = Common::make_unique<EmuWindow_SDL2>();
VideoCore::g_hw_renderer_enabled = Settings::values.use_hw_renderer;
VideoCore::g_shader_jit_enabled = Settings::values.use_shader_jit;
- System::Init(emu_window);
+ System::Init(emu_window.get());
+ SCOPE_EXIT({ System::Shutdown(); });
Loader::ResultStatus load_result = Loader::LoadFile(boot_filename);
if (Loader::ResultStatus::Success != load_result) {
@@ -93,11 +97,5 @@ int main(int argc, char **argv) {
Core::RunLoop();
}
- System::Shutdown();
-
- delete emu_window;
-
- MicroProfileShutdown();
-
return 0;
}