From b38223f662e8e5202516079c1e5882121a2fe698 Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 4 Jan 2018 13:40:01 -0500 Subject: arm_unicorn: Load/release unicorn DLL. --- src/core/arm/unicorn/arm_unicorn.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp index 92aef0654..1d15152e5 100644 --- a/src/core/arm/unicorn/arm_unicorn.cpp +++ b/src/core/arm/unicorn/arm_unicorn.cpp @@ -10,6 +10,22 @@ #include "core/core_timing.h" #include "core/hle/kernel/svc.h" +// Load Unicorn DLL once on Windows using RAII +#ifdef _WIN32 +#include +struct LoadDll { +private: + LoadDll() { + ASSERT(uc_dyn_load(NULL, 0)); + } + ~LoadDll() { + ASSERT(uc_dyn_free()); + } + static LoadDll g_load_dll; +}; +LoadDll LoadDll::g_load_dll; +#endif + #define CHECKED(expr) \ do { \ if (auto _cerr = (expr)) { \ -- cgit v1.2.3