From fc5d86401c73b42eb45e5ae62a7fc16dc57e60e9 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 3 Oct 2011 03:23:05 +0200 Subject: core.environment: fixed crash induced by previous commit --- ranger/core/environment.py | 4 ++-- ranger/core/fm.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ranger/core/environment.py b/ranger/core/environment.py index 45fa7f4c..c5279f0d 100644 --- a/ranger/core/environment.py +++ b/ranger/core/environment.py @@ -116,14 +116,14 @@ class Environment(SettingsAware, SignalDispatcher): except KeyError: return directory - def garbage_collect(self, age): + def garbage_collect(self, age, tabs): """Delete unused directory objects""" for key in tuple(self.directories): value = self.directories[key] if age != -1: if not value.is_older_than(age) or value in self.pathway: continue - if value in self.fm.tabs.values(): + if value in tabs.values(): continue del self.directories[key] if value.is_directory: diff --git a/ranger/core/fm.py b/ranger/core/fm.py index c292e0c9..9192f15c 100644 --- a/ranger/core/fm.py +++ b/ranger/core/fm.py @@ -204,7 +204,8 @@ class FM(Actions, SignalDispatcher): gc_tick += 1 if gc_tick > TICKS_BEFORE_COLLECTING_GARBAGE: gc_tick = 0 - env.garbage_collect(TIME_BEFORE_FILE_BECOMES_GARBAGE) + env.garbage_collect(TIME_BEFORE_FILE_BECOMES_GARBAGE, + self.tabs) except KeyboardInterrupt: # this only happens in --debug mode. By default, interrupts -- cgit 1.4.1-2-gfad0