From: Zac Medico Date: Fri, 10 Feb 2012 21:58:17 +0000 (-0800) Subject: Scheduler: cleanup timeout after _main_loop X-Git-Tag: v2.2.0_alpha86~20 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8384ee6a6116a9055601fe7729026af2024f4fa0;p=portage.git Scheduler: cleanup timeout after _main_loop The way we don't leave an leak a reference to the Scheduler instance in the global EventLoop instance. --- diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index 674a11e49..100d89d1c 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -196,8 +196,6 @@ class Scheduler(PollScheduler): self._status_display = JobStatusDisplay( xterm_titles=('notitles' not in settings.features)) - self.sched_iface.timeout_add(self._max_display_latency, - self._status_display.display) self._max_load = myopts.get("--load-average") max_jobs = myopts.get("--jobs") if max_jobs is None: @@ -1354,6 +1352,8 @@ class Scheduler(PollScheduler): failed_pkgs = self._failed_pkgs portage.locks._quiet = self._background portage.elog.add_listener(self._elog_listener) + display_timeout_id = self.sched_iface.timeout_add( + self._max_display_latency, self._status_display.display) rval = os.EX_OK try: @@ -1362,6 +1362,7 @@ class Scheduler(PollScheduler): self._main_loop_cleanup() portage.locks._quiet = False portage.elog.remove_listener(self._elog_listener) + self.sched_iface.source_remove(display_timeout_id) if failed_pkgs: rval = failed_pkgs[-1].returncode