kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. (#3154)

* kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects.

- See https://github.com/citra-emu/citra/pull/4710 for details.
This commit is contained in:
bunnei
2019-11-24 20:15:51 -05:00
committed by GitHub
parent b03242067d
commit 9046d4a548
74 changed files with 377 additions and 378 deletions

View File

@ -16,25 +16,20 @@ ClientSession::ClientSession(KernelCore& kernel) : Object{kernel} {}
ClientSession::~ClientSession() {
// This destructor will be called automatically when the last ClientSession handle is closed by
// the emulated application.
// A local reference to the ServerSession is necessary to guarantee it
// will be kept alive until after ClientDisconnected() returns.
SharedPtr<ServerSession> server = parent->server;
if (server) {
server->ClientDisconnected();
if (parent->server) {
parent->server->ClientDisconnected();
}
parent->client = nullptr;
}
ResultCode ClientSession::SendSyncRequest(SharedPtr<Thread> thread) {
ResultCode ClientSession::SendSyncRequest(Thread* thread) {
// Keep ServerSession alive until we're done working with it.
SharedPtr<ServerSession> server = parent->server;
if (server == nullptr)
if (parent->server == nullptr)
return ERR_SESSION_CLOSED_BY_REMOTE;
// Signal the server session that new data is available
return server->HandleSyncRequest(std::move(thread));
return parent->server->HandleSyncRequest(SharedFrom(thread));
}
} // namespace Kernel