mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 18:53:28 +01:00
Fix ipc_manager::add
Thanks to @Farseer2 for debugging
This commit is contained in:
parent
26e13b4f5f
commit
da3f3fd1fb
@ -26,7 +26,9 @@ public:
|
||||
// Get object location
|
||||
std::weak_ptr<T>& wptr = g_ipc.m_map[ipc_key];
|
||||
|
||||
if ((out && !(*out = wptr.lock())) || wptr.expired())
|
||||
std::shared_ptr<T> old;
|
||||
|
||||
if ((out && !(old = wptr.lock())) || wptr.expired())
|
||||
{
|
||||
// Call a function which must return the object
|
||||
if (out)
|
||||
@ -42,6 +44,11 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
if (out)
|
||||
{
|
||||
*out = std::move(old);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user