diff options
author | Huang Peng <shawn.p.huang@gmail.com> | 2008-07-30 11:07:13 +0800 |
---|---|---|
committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-07-30 11:07:13 +0800 |
commit | 1cc99dd2714e92d93a0fde0042d108f0b432b33a (patch) | |
tree | c8c27c0f268426fc969a1f7c1d63051b06897ed8 /gconf | |
parent | 57881cd0347f38cd6923cf5c96450c7e3bbd87fe (diff) | |
download | ibus-1cc99dd2714e92d93a0fde0042d108f0b432b33a.tar.gz ibus-1cc99dd2714e92d93a0fde0042d108f0b432b33a.tar.xz ibus-1cc99dd2714e92d93a0fde0042d108f0b432b33a.zip |
Fix problem in config.Destroy.
Diffstat (limited to 'gconf')
-rw-r--r-- | gconf/config.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gconf/config.py b/gconf/config.py index 6799394..2a2149c 100644 --- a/gconf/config.py +++ b/gconf/config.py @@ -26,7 +26,7 @@ from ibus import interface GCONF_IBUS_PATH = "/desktop/ibus" class Config(ibus.Object): - def __init__ (self, conn, path): + def __init__ (self, conn = None, path = None): super(Config, self).__init__() self.__proxy = ConfigProxy(self, conn, path) self.__client = gconf.Client() @@ -48,9 +48,12 @@ class Config(ibus.Object): self.__client.set(key, value) def do_destroy(self): - self.__proxy = None - self.__client.disconnect(self.__handler_id) - self.__client = None + if self.__proxy: + self.__proxy.Destriy() + self.__proxy = None + if self.__client: + self.__client.disconnect(self.__handler_id) + self.__client = None def __to_py_value(self, value): if value.type == gconf.VALUE_STRING: @@ -119,5 +122,6 @@ class ConfigProxy(interface.IConfig): def Destroy(self): self.remove_from_connection() - self.__config.destroy() - self.__config = None + if self.__config: + self.__config.destroy() + self.__config = None |