summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfujiwarat <takao.fujiwara1@gmail.com>2014-08-21 19:31:44 +0900
committerfujiwarat <takao.fujiwara1@gmail.com>2014-09-16 02:57:26 +0900
commit7650f72922c9989db0a99c68fa47a47d68fd17ff (patch)
tree7b858539523bda125aab362599eb496e2aed41c8
parent53c6f97bdb7a444dda9003c114605edd405510b3 (diff)
downloadibus-anthy-7650f72922c9989db0a99c68fa47a47d68fd17ff.tar.gz
Fix to unref pixbuf when propery icon is unrefed.
-rw-r--r--engine/python2/engine.py1
-rw-r--r--engine/python2/propertyicon.py6
-rw-r--r--engine/python3/engine.py1
-rw-r--r--engine/python3/propertyicon.py6
4 files changed, 14 insertions, 0 deletions
diff --git a/engine/python2/engine.py b/engine/python2/engine.py
index 3339eda..5995375 100644
--- a/engine/python2/engine.py
+++ b/engine/python2/engine.py
@@ -1104,6 +1104,7 @@ class Engine(IBus.EngineSimple):
# It seems do_destroy() is called when launch_engine() is called.
#self.__remove_dict_files()
# It seems super.destroy() does not unref the engine.
+ self.__input_mode_icon.clear()
self.__input_mode_icon = None
def __join_all_segments(self):
diff --git a/engine/python2/propertyicon.py b/engine/python2/propertyicon.py
index fa5f34f..437e94c 100644
--- a/engine/python2/propertyicon.py
+++ b/engine/python2/propertyicon.py
@@ -76,6 +76,12 @@ class PropertyIcon(Gtk.StatusIcon):
self.__xkb_icon_pixbufs[symbol] = pixbuf
return pixbuf
+ def clear(self):
+ self.set_from_icon_name('')
+ self.set_visible(False)
+ self.__xkb_icon_pixbufs = {}
+ self.__xkb_icon_rgba = None
+
def set_from_symbol(self, symbol):
pixbuf = self.__create_icon_pixbuf_with_string(symbol)
self.set_from_pixbuf(pixbuf)
diff --git a/engine/python3/engine.py b/engine/python3/engine.py
index ab9e8fa..73de005 100644
--- a/engine/python3/engine.py
+++ b/engine/python3/engine.py
@@ -1099,6 +1099,7 @@ class Engine(IBus.EngineSimple):
# It seems do_destroy() is called when launch_engine() is called.
#self.__remove_dict_files()
# It seems super.destroy() does not unref the engine.
+ self.__input_mode_icon.clear()
self.__input_mode_icon = None
def __join_all_segments(self):
diff --git a/engine/python3/propertyicon.py b/engine/python3/propertyicon.py
index fa5f34f..437e94c 100644
--- a/engine/python3/propertyicon.py
+++ b/engine/python3/propertyicon.py
@@ -76,6 +76,12 @@ class PropertyIcon(Gtk.StatusIcon):
self.__xkb_icon_pixbufs[symbol] = pixbuf
return pixbuf
+ def clear(self):
+ self.set_from_icon_name('')
+ self.set_visible(False)
+ self.__xkb_icon_pixbufs = {}
+ self.__xkb_icon_rgba = None
+
def set_from_symbol(self, symbol):
pixbuf = self.__create_icon_pixbuf_with_string(symbol)
self.set_from_pixbuf(pixbuf)