From ead4e4d89d516c76f9244c02cc0fb2df54129b1a Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 6 Oct 2006 21:00:18 +0000 Subject: [PATCH] Don't freak out if we're reinitialized. Just replace the resource manager reference and leave the same Handler registered. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@44 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/java/com/threerings/resource/Handler.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/java/com/threerings/resource/Handler.java b/src/java/com/threerings/resource/Handler.java index a30aec2b..4583a3e8 100644 --- a/src/java/com/threerings/resource/Handler.java +++ b/src/java/com/threerings/resource/Handler.java @@ -58,16 +58,13 @@ public class Handler extends URLStreamHandler */ public static void registerHandler (ResourceManager rmgr) { - // if we already have a resource manager registered; don't - // register another one - if (_rmgr != null) { - Log.warning("Refusing duplicate resource handler registration."); - return; + // we only want to wire up our Handler once, but if a new resource + // manager comes along, we'll point the existing handler there + if (_rmgr == null) { + // wire up our handler with the handy dandy attachable URL factory + AttachableURLFactory.attachHandler("resource", Handler.class); } _rmgr = rmgr; - - // wire up our handler with the handy dandy attachable URL factory - AttachableURLFactory.attachHandler("resource", Handler.class); } // documentation inherited