Skip to content

Commit

Permalink
server: fix leaking self-referential fx::Client objects
Browse files Browse the repository at this point in the history
  • Loading branch information
blattersturm committed Jan 5, 2019
1 parent 37b5818 commit 25e8494
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/components/citizen-server-impl/src/ClientRegistry.cpp
Expand Up @@ -28,7 +28,7 @@ namespace fx
m_clientsByNetId[weakClient.lock()->GetNetId()] = weakClient;
});

client->OnAssignPeer.Connect([=]()
client->OnAssignPeer.Connect([this, weakClient]()
{
m_clientsByPeer[weakClient.lock()->GetPeer()] = weakClient;

Expand All @@ -47,7 +47,7 @@ namespace fx

if (m_clientsBySlotId[slot].expired())
{
client->SetSlotId(slot);
weakClient.lock()->SetSlotId(slot);

m_clientsBySlotId[slot] = weakClient;

Expand Down

0 comments on commit 25e8494

Please sign in to comment.