diff options
author | Jens Schmer <jens.schmer+git@gmail.com> | 2018-12-12 20:07:14 +0100 |
---|---|---|
committer | Jens Schmer <jens.schmer+git@gmail.com> | 2018-12-13 20:08:23 +0100 |
commit | 27a9cc2e63d07989fdb4efeeb6a6b3417281f177 (patch) | |
tree | 7df6d4eadc9af7b42e467576dbf16528664f8a9e /src/core/hle/service/service.cpp | |
parent | Merge pull request #1890 from jschmer/master (diff) | |
download | yuzu-27a9cc2e63d07989fdb4efeeb6a6b3417281f177.tar yuzu-27a9cc2e63d07989fdb4efeeb6a6b3417281f177.tar.gz yuzu-27a9cc2e63d07989fdb4efeeb6a6b3417281f177.tar.bz2 yuzu-27a9cc2e63d07989fdb4efeeb6a6b3417281f177.tar.lz yuzu-27a9cc2e63d07989fdb4efeeb6a6b3417281f177.tar.xz yuzu-27a9cc2e63d07989fdb4efeeb6a6b3417281f177.tar.zst yuzu-27a9cc2e63d07989fdb4efeeb6a6b3417281f177.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/service.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index d41df3732..d25b80ab0 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -97,29 +97,33 @@ ServiceFrameworkBase::ServiceFrameworkBase(const char* service_name, u32 max_ses ServiceFrameworkBase::~ServiceFrameworkBase() = default; void ServiceFrameworkBase::InstallAsService(SM::ServiceManager& service_manager) { - ASSERT(port == nullptr); - port = service_manager.RegisterService(service_name, max_sessions).Unwrap(); + ASSERT(!port_installed); + + auto port = service_manager.RegisterService(service_name, max_sessions).Unwrap(); port->SetHleHandler(shared_from_this()); + port_installed = true; } void ServiceFrameworkBase::InstallAsNamedPort() { - ASSERT(port == nullptr); + ASSERT(!port_installed); auto& kernel = Core::System::GetInstance().Kernel(); auto [server_port, client_port] = Kernel::ServerPort::CreatePortPair(kernel, max_sessions, service_name); server_port->SetHleHandler(shared_from_this()); kernel.AddNamedPort(service_name, std::move(client_port)); + port_installed = true; } Kernel::SharedPtr<Kernel::ClientPort> ServiceFrameworkBase::CreatePort() { - ASSERT(port == nullptr); + ASSERT(!port_installed); auto& kernel = Core::System::GetInstance().Kernel(); auto [server_port, client_port] = Kernel::ServerPort::CreatePortPair(kernel, max_sessions, service_name); - port = MakeResult(std::move(server_port)).Unwrap(); + auto port = MakeResult(std::move(server_port)).Unwrap(); port->SetHleHandler(shared_from_this()); + port_installed = true; return client_port; } |