From 06a89ca9b109a67ec994338796d8d5c0763b8ac1 Mon Sep 17 00:00:00 2001 From: Kevin Hartman Date: Sat, 21 Feb 2015 13:36:19 -0800 Subject: [PATCH] Made g_stub_service a SharedPtr. --- src/core/hle/service/service.cpp | 4 +++- src/core/hle/service/service.h | 2 +- src/core/hle/service/srv.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index fbec9c1e9..d36542ccc 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -58,7 +58,7 @@ namespace Service { std::unordered_map> g_kernel_named_ports; std::unordered_map> g_srv_services; -Interface g_stub_service; +Kernel::SharedPtr g_stub_service; //////////////////////////////////////////////////////////////////////////////////////////////////// // Module interface @@ -73,6 +73,8 @@ static void AddService(Interface* interface) { /// Initialize ServiceManager void Init() { + g_stub_service = new Interface; + AddNamedPort(new SRV::Interface); AddNamedPort(new ERR_F::Interface); diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index b6bada586..a684d5c0a 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -120,6 +120,6 @@ extern std::unordered_map> g_kernel_na /// Map of services registered with the "srv:" service, retrieved using GetServiceHandle. extern std::unordered_map> g_srv_services; /// Returned to callers when the requested service is not yet implemented -extern Interface g_stub_service; +extern Kernel::SharedPtr g_stub_service; } // namespace diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index 52e73a42e..471091e65 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp @@ -47,7 +47,7 @@ static void GetServiceHandle(Service::Interface* self) { UNIMPLEMENTED(); // Return the stubbed (empty) service so that applications can continue - cmd_buff[3] = Kernel::g_handle_table.Create(&Service::g_stub_service).MoveFrom(); + cmd_buff[3] = Kernel::g_handle_table.Create(Service::g_stub_service).MoveFrom(); } cmd_buff[1] = res.raw;