diff --git a/direct/src/distributed/ClientRepository.py b/direct/src/distributed/ClientRepository.py index 36ce094ab8..87ff6a9ebc 100644 --- a/direct/src/distributed/ClientRepository.py +++ b/direct/src/distributed/ClientRepository.py @@ -29,6 +29,8 @@ class ClientRepository(ClientRepositoryBase): ClientRepositoryBase.__init__(self, dcFileNames = dcFileNames, dcSuffix = dcSuffix, connectMethod = connectMethod, threadedNet = threadedNet) self.setHandleDatagramsInternally(False) + base.finalExitCallbacks.append(self.shutdown) + # The doId allocator. The CMU LAN server may choose to # send us a block of doIds. If it chooses to do so, then we # may create objects, using those doIds. diff --git a/direct/src/distributed/ConnectionRepository.py b/direct/src/distributed/ConnectionRepository.py index a1f3e5dbb1..1e7af0f2c2 100644 --- a/direct/src/distributed/ConnectionRepository.py +++ b/direct/src/distributed/ConnectionRepository.py @@ -56,8 +56,6 @@ class ConnectionRepository( # the world, helpful for sending messages specific to each one. self.uniqueId = hash(self) - base.finalExitCallbacks.append(self.shutdown) - # Accept this hook so that we can respond to lost-connection # events in the main thread, instead of within the network # thread (if there is one). diff --git a/direct/src/distributed/ServerRepository.py b/direct/src/distributed/ServerRepository.py index e53b65ebbb..28a771eaf3 100644 --- a/direct/src/distributed/ServerRepository.py +++ b/direct/src/distributed/ServerRepository.py @@ -84,6 +84,8 @@ class ServerRepository: if threadedNet is None: # Default value. threadedNet = config.GetBool('threaded-net', False) + + base.finalExitCallbacks.append(self.shutdown) # Set up networking interfaces. numThreads = 0