summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-10-03 03:23:05 +0200
committerhut <hut@lavabit.com>2011-10-03 03:23:05 +0200
commitfc5d86401c73b42eb45e5ae62a7fc16dc57e60e9 (patch)
treea05dba5647bbf33d87b433a6f576c3a363a91b6e /ranger
parentaee68749667e2fe6a91d034f65f919bcdf57f806 (diff)
downloadranger-fc5d86401c73b42eb45e5ae62a7fc16dc57e60e9.tar.gz
core.environment: fixed crash induced by previous commit
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/environment.py4
-rw-r--r--ranger/core/fm.py3
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