Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpgritti@gmail.com>2008-09-06 14:59:44 (GMT)
committer Marco Pesenti Gritti <mpgritti@gmail.com>2008-09-06 15:03:29 (GMT)
commit98a560264f4ab85d848dff740fae60d95576de31 (patch)
tree4f2cc944559f863c8bb0861b0f11ebc592b70fad
parent77f2146f419dba79c8df9f5cc577a3fd4a3707aa (diff)
Do not leak launchers. Fix #8300
-rw-r--r--src/view/Shell.py24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/view/Shell.py b/src/view/Shell.py
index bfaa72e..c350025 100644
--- a/src/view/Shell.py
+++ b/src/view/Shell.py
@@ -103,28 +103,22 @@ class Shell(gobject.GObject):
self._model.set_zoom_level(shellmodel.ShellModel.ZOOM_ACTIVITY)
def __launch_failed_cb(self, home_model, home_activity):
- if home_activity.is_journal():
- return
-
- activity_id = home_activity.get_activity_id()
-
- launch_window = self._launchers[activity_id]
- if launch_window:
- launch_window.destroy()
- else:
- logging.error('Launcher for %s is missing' % activity_id)
+ if not home_activity.is_journal():
+ self._destroy_launcher(home_activity)
def __launch_completed_cb(self, home_model, home_activity):
activity_host = ActivityHost(home_activity)
self._hosts[activity_host.get_xid()] = activity_host
- if home_activity.is_journal():
- return
+ if not home_activity.is_journal():
+ self._destroy_launcher(home_activity)
+ def _destroy_launcher(self, home_activity):
activity_id = home_activity.get_activity_id()
- launch_window = self._launchers[activity_id]
- if launch_window:
- launch_window.destroy()
+
+ if activity_id in self._launchers:
+ self._launchers[activity_id].destroy()
+ del self._launchers[activity_id]
else:
logging.error('Launcher for %s is missing' % activity_id)