From 2b6a4a1a5ab517d59d162f679d965802a1ec7bba Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 18 Apr 2002 22:37:08 +0000 Subject: [PATCH] Destroy the client object if we decide to unmap it because we're the only ones that know that such an action is safe and we don't want stray client objects lying around cluttering things up. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1278 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/presents/server/ClientManager.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/presents/server/ClientManager.java b/src/java/com/threerings/presents/server/ClientManager.java index a68776d22..a4d5ea939 100644 --- a/src/java/com/threerings/presents/server/ClientManager.java +++ b/src/java/com/threerings/presents/server/ClientManager.java @@ -1,5 +1,5 @@ // -// $Id: ClientManager.java,v 1.16 2002/04/18 20:46:43 mdb Exp $ +// $Id: ClientManager.java,v 1.17 2002/04/18 22:37:08 mdb Exp $ package com.threerings.presents.server; @@ -163,14 +163,17 @@ public class ClientManager implements ConnectionObserver * If an entity resolves a client object outside the scope of a normal * client session, it should call this to unmap the client object when * it's finished. This won't actually unmap the client if someone came - * along and started a session for that client in the meanwhile. + * along and started a session for that client in the meanwhile, but + * if it does unmap the client it will also destroy the client object + * (finishing the job, as it were). */ public synchronized void unmapClientObject (String username) { // we only remove the mapping if there's not a session in progress // (which is indicated by a mapping in the usermap table) if (!_usermap.containsKey(username)) { - _objmap.remove(username); + ClientObject clobj = (ClientObject)_objmap.remove(username); + PresentsServer.omgr.destroyObject(clobj.getOid()); } }