From 39a745bdaa7adf127f0f600e8541c1f7a5f5dfe0 Mon Sep 17 00:00:00 2001 From: David Rose Date: Sat, 19 Dec 2009 07:19:38 +0000 Subject: [PATCH] protect for threading --- direct/src/distributed/ServerRepository.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/direct/src/distributed/ServerRepository.py b/direct/src/distributed/ServerRepository.py index 8352951e19..ab5b2372c8 100644 --- a/direct/src/distributed/ServerRepository.py +++ b/direct/src/distributed/ServerRepository.py @@ -302,8 +302,7 @@ class ServerRepository: return task.cont # Crazy dereferencing - newConnection=newConnection.p() - self.qcr.addConnection(newConnection) + newConnection = newConnection.p() # Add clients information to dictionary id = self.idAllocator.allocate() @@ -315,6 +314,9 @@ class ServerRepository: client = self.Client(newConnection, netAddress, doIdBase) self.clientsByConnection[client.connection] = client self.clientsByDoIdBase[client.doIdBase] = client + + # Now we can start listening to that new connection. + self.qcr.addConnection(newConnection) self.lastConnection = newConnection self.sendDoIdRange(client)