Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Multiple dbus_interface methods #9

Merged
1 commit merged into from Jan 3, 2011
Jump to file or symbol
Failed to load files and symbols.
+4 −2
Split
View
@@ -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