From 4104010c88a499cdcfbf91f51381a602c7f57b7d Mon Sep 17 00:00:00 2001 From: seki Date: Sun, 1 Mar 2009 15:57:33 +0000 Subject: [PATCH] merged a patch from Alessandro Di Maria in [ruby-core:22560]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ lib/drb/observer.rb | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30a2613492..fd1779d67f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Mar 2 00:56:45 2009 Masatoshi SEKI + + * lib/drb/observer.rb: The module oberservable uses now a hash to + store listeners. merged a patch from Alessandro Di Maria in + [ruby-core:22560]. + Sun Mar 1 22:59:41 2009 Tanaka Akira * ext/socket/raddrinfo.c: suppress warnings. diff --git a/lib/drb/observer.rb b/lib/drb/observer.rb index e7f1668c52..149426db7b 100644 --- a/lib/drb/observer.rb +++ b/lib/drb/observer.rb @@ -6,16 +6,16 @@ module DRb def notify_observers(*arg) if defined? @observer_state and @observer_state - if defined? @observer_peers - for i in @observer_peers.dup - begin - i.update(*arg) - rescue - delete_observer(i) - end - end - end - @observer_state = false + if defined? @observer_peers + @observer_peers.each do |observer, method| + begin + observer.send(method, *arg) + rescue + delete_observer(observer) + end + end + end + @observer_state = false end end end