Handle the situation where a referred object and the referring object are

both destroyed without any intervening event processing.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3186 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2004-10-28 21:59:00 +00:00
parent abc4e9c86a
commit dd1f895190
@@ -1,5 +1,5 @@
// //
// $Id: PresentsDObjectMgr.java,v 1.47 2004/08/27 02:20:23 mdb Exp $ // $Id: PresentsDObjectMgr.java,v 1.48 2004/10/28 21:59:00 mdb Exp $
// //
// Narya library - tools for developing networked games // Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved // Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -501,7 +501,13 @@ public class PresentsDObjectMgr
} }
} }
if (ref == null) { // if a referred object and referring object are both destroyed without
// allowing the referred object destruction to process the ObjectRemoved
// event which is auto-generated, the subsequent destruction of the
// referring object will attempt to clear the reference to the referred
// object which no longer exists; so we don't complain about non-
// existent references if the referree is already destroyed
if (ref == null && _objects.containsKey(reffedOid)) {
Log.warning("Requested to clear out non-existent reference " + Log.warning("Requested to clear out non-existent reference " +
"[refferOid=" + reffer.getOid() + "[refferOid=" + reffer.getOid() +
", field=" + field + ", field=" + field +
@@ -583,6 +589,9 @@ public class PresentsDObjectMgr
int toid = target.getOid(); int toid = target.getOid();
int oid = ore.getOid(); int oid = ore.getOid();
// Log.info("Processing object removed [from=" + toid +
// ", roid=" + toid + "].");
// get the reference vector for the referenced object // get the reference vector for the referenced object
Reference[] refs = (Reference[])_refs.get(oid); Reference[] refs = (Reference[])_refs.get(oid);
if (refs == null) { if (refs == null) {
@@ -591,7 +600,7 @@ public class PresentsDObjectMgr
// generate object removed events for all of its referencees. // generate object removed events for all of its referencees.
// so we opt not to log anything in this case // so we opt not to log anything in this case
// Log.warning("Object removed without reference to track it " + // Log.info("Object removed without reference to track it " +
// "[toid=" + toid + ", field=" + field + // "[toid=" + toid + ", field=" + field +
// ", oid=" + oid + "]."); // ", oid=" + oid + "].");
return true; return true;