diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index 637e629c0..14e98273e 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -147,9 +147,8 @@ class ImpressController(PresentationController): Called at system exit to clean up any running presentations """ log.debug(u'Kill OpenOffice') - for i in range(len(self.docs)): - self.docs[0].close_presentation() # Yes, always the zeroth one - # as close removes item from array + while self.docs: + self.docs[0].close_presentation() if os.name != u'nt': desktop = self.get_uno_desktop() else: diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 3dedcec75..67870574d 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -82,9 +82,8 @@ class PowerpointController(PresentationController): Called at system exit to clean up any running presentations """ log.debug(u'Kill powerpoint') - for i in range(len(self.docs)): - self.docs[0].close_presentation() # Yes, always the zeroth one - # as close removes item from array + while self.docs: + self.docs[0].close_presentation() if self.process is None: return if self.process.Presentations.Count > 0: diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index 5646c7258..455e1c601 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -89,9 +89,8 @@ class PptviewController(PresentationController): Called at system exit to clean up any running presentations """ log.debug(u'Kill pptviewer') - for i in range(len(self.docs)): - self.docs[0].close_presentation() # Yes, always the zeroth one - # as close removes item from array + while self.docs: + self.docs[0].close_presentation() def add_doc(self, name): log.debug(u'Add Doc PPTView')