about summary refs log tree commit diff stats
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
parentaee68749667e2fe6a91d034f65f919bcdf57f806 (diff)
downloadranger-fc5d86401c73b42eb45e5ae62a7fc16dc57e60e9.tar.gz
core.environment: fixed crash induced by previous commit
-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
ef='#n174'>174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252