Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #I have many instance of this object
- class BlargProblematic(object):
- #nothing wrong where
- def __init__(self, con, rule):
- self.con = con #GDBusConnection
- self.rule = rule #string
- proxy = Gio.DBusProxy.new_sync(
- self.con, #cpmmectopm
- Gio.DBusProxyFlags.NONE,
- None, #DBusInterfaceInfo
- "org.freedesktop.DBus", #name
- "/", #path
- "org.freedesktop.DBus", #iface
- None)
- proxy.AddMatch("(s)", self.rule)
- # something goes wrong here :/
- def __del__(self):
- proxy = Gio.DBusProxy.new_sync(
- self.con, #cpmmectopm
- Gio.DBusProxyFlags.NONE,
- None, #DBusInterfaceInfo
- "org.freedesktop.DBus", #name
- "/", #path
- "org.freedesktop.DBus", #iface
- None)
- proxy.RemoveMatch(self.rule)
- #I have many instance of this object too
- class BlargTestingSolution(object):
- #nothing wrong here
- def __init__(self, con, rule):
- self.con = con #GDBusConnection
- self.rule = rule #string
- self.proxy = Gio.DBusProxy.new_sync(
- self.con, #cpmmectopm
- Gio.DBusProxyFlags.NONE,
- None, #DBusInterfaceInfo
- "org.freedesktop.DBus", #name
- "/", #path
- "org.freedesktop.DBus", #iface
- None)
- self.proxy.AddMatch("(s)", self.rule)
- # (probably) nothing wrong here (I'm testing)
- def __del__(self):
- self.proxy.RemoveMatch(self.rule)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement