prevent loading the same dispatcher multiple times. fixes #560
git-svn-id: file:///home/svn/framework3/trunk@7587 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
0d44958233
commit
f8d84a7dc9
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue