prevent loading the same dispatcher multiple times. fixes #560

git-svn-id: file:///home/svn/framework3/trunk@7587 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2009-11-24 01:07:19 +00:00
parent 0d44958233
commit f8d84a7dc9
1 changed files with 7 additions and 1 deletions

View File

@ -265,7 +265,13 @@ module DispatcherShell
# it doesn't affect any enstack'd dispatchers.
#
def append_dispatcher(dispatcher)
self.dispatcher_stack.push(inst = dispatcher.new(self))
inst = dispatcher.new(self)
self.dispatcher_stack.each { |disp|
if (disp.name == inst.name)
raise RuntimeError.new("Attempting to load already loaded dispatcher #{disp.name}")
end
}
self.dispatcher_stack.push(inst)
inst
end