summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-12-11 22:18:54 +0100
committerhut <hut@lavabit.com>2012-12-11 22:18:54 +0100
commitbcd3f81c07818d5bd87d53f50a126071fcc2a175 (patch)
tree34027b7c40eb82b1b7ca2cfda78438f905f70b72 /ranger
parent5e120675d84b16720a66888a2cfb580deb4c6c9b (diff)
downloadranger-bcd3f81c07818d5bd87d53f50a126071fcc2a175.tar.gz
core.loader: ensure that loaders are stopped on error
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/loader.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/ranger/core/loader.py b/ranger/core/loader.py
index f1be697a..4437d028 100644
--- a/ranger/core/loader.py
+++ b/ranger/core/loader.py
@@ -339,12 +339,16 @@ class Loader(FileManagerAware):
 			if item.progressbar_supported:
 				self.fm.ui.status.request_redraw()
 		except StopIteration:
-			item.load_generator = None
-			self.queue.remove(item)
-			if item.progressbar_supported:
-				self.fm.ui.status.request_redraw()
+			self._remove_current_process(item)
 		except Exception as err:
 			self.fm.notify(err)
+			self._remove_current_process(item)
+
+	def _remove_current_process(self, item):
+		item.load_generator = None
+		self.queue.remove(item)
+		if item.progressbar_supported:
+			self.fm.ui.status.request_redraw()
 
 	def has_work(self):
 		"""Is there anything to load?"""