Skip to content
Browse files

Allow multiple dbus_interface methods for same interfaces.

  • Loading branch information...
1 parent 589b11a commit c326ad0e42cc11d3d598e8d1c42d10f072bdd648 @ytaka committed Jan 3, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/dbus/export.rb
View
6 lib/dbus/export.rb
@@ -73,8 +73,10 @@ def dispatch(msg)
# belong to.
def self.dbus_interface(s)
@@intfs_mutex.synchronize do
- @@cur_intf = Interface.new(s)
- self.intfs = (self.intfs || {}).merge({s => @@cur_intf})
+ unless @@cur_intf = (self.intfs && self.intfs[s])
+ @@cur_intf = Interface.new(s)
+ self.intfs = (self.intfs || {}).merge({s => @@cur_intf})
+ end
yield
@@cur_intf = nil
end

0 comments on commit c326ad0

Please sign in to comment.
Something went wrong with that request. Please try again.