From 8a67066c57e0fceeb195f8d396cab15922e01710 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sat, 11 Aug 2001 00:11:53 +0000 Subject: [PATCH] Do the right thing if subscribers remove themselves after we've been destroyed. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@217 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/presents/dobj/DObject.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/presents/dobj/DObject.java b/src/java/com/threerings/presents/dobj/DObject.java index 3764eba81..34853f412 100644 --- a/src/java/com/threerings/presents/dobj/DObject.java +++ b/src/java/com/threerings/presents/dobj/DObject.java @@ -1,5 +1,5 @@ // -// $Id: DObject.java,v 1.21 2001/08/08 00:28:49 mdb Exp $ +// $Id: DObject.java,v 1.22 2001/08/11 00:11:53 mdb Exp $ package com.threerings.cocktail.cher.dobj; @@ -122,8 +122,10 @@ public class DObject { if (_subscribers.remove(sub)) { // if we removed something, check to see if we just removed - // the last subscriber from our list - if (_subscribers.size() == 0) { + // the last subscriber from our list; we also want to be sure + // that we're still active otherwise there's no need to notify + // our objmgr because we don't have one + if (_subscribers.size() == 0 && _mgr != null) { _mgr.removedLastSubscriber(this); } }