diff options
-rw-r--r-- | ranger/core/environment.py | 4 | ||||
-rw-r--r-- | 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 |