Made g_stub_service a SharedPtr.

This commit is contained in:
Kevin Hartman 2015-02-21 13:36:19 -08:00
parent e1008c862d
commit 06a89ca9b1
3 changed files with 5 additions and 3 deletions

View File

@ -58,7 +58,7 @@ namespace Service {
std::unordered_map<std::string, Kernel::SharedPtr<Interface>> g_kernel_named_ports;
std::unordered_map<std::string, Kernel::SharedPtr<Interface>> g_srv_services;
Interface g_stub_service;
Kernel::SharedPtr<Interface> 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);

View File

@ -120,6 +120,6 @@ extern std::unordered_map<std::string, Kernel::SharedPtr<Interface>> g_kernel_na
/// Map of services registered with the "srv:" service, retrieved using GetServiceHandle.
extern std::unordered_map<std::string, Kernel::SharedPtr<Interface>> g_srv_services;
/// Returned to callers when the requested service is not yet implemented
extern Interface g_stub_service;
extern Kernel::SharedPtr<Interface> g_stub_service;
} // namespace

View File

@ -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;