From adc45ae767dca2475d08a5315c113cc114cd5ba4 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Thu, 15 Jun 2017 08:26:30 -0500 Subject: [PATCH] Delete timer objects for buffers before destroying them --- src/controller/buffersController.py | 6 ++---- src/controller/mainController.py | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/controller/buffersController.py b/src/controller/buffersController.py index 0266db15..696fe523 100644 --- a/src/controller/buffersController.py +++ b/src/controller/buffersController.py @@ -996,7 +996,6 @@ class searchBufferController(baseBufferController): if self.name[:-11] in self.session.settings["other_buffers"]["tweet_searches"]: self.session.settings["other_buffers"]["tweet_searches"].remove(self.name[:-11]) self.session.settings.write() - self.timer.cancel() if self.session.db.has_key(self.name): self.session.db.pop(self.name) return True @@ -1042,7 +1041,6 @@ class searchPeopleBufferController(peopleBufferController): if self.name[:-11] in self.session.settings["other_buffers"]["tweet_searches"]: self.session.settings["other_buffers"]["tweet_searches"].remove(self.name[:-11]) self.session.settings.write() - self.timer.cancel() if self.session.db.has_key(self.name): self.session.db.pop(self.name) return True @@ -1115,7 +1113,6 @@ class trendsBufferController(bufferController): if self.name[:-3] in self.session.settings["other_buffers"]["trending_topic_buffers"]: self.session.settings["other_buffers"]["trending_topic_buffers"].remove(self.name[:-3]) self.session.settings.write() - self.timer.cancel() if self.session.db.has_key(self.name): self.session.db.pop(self.name) return True @@ -1214,7 +1211,8 @@ class conversationBufferController(searchBufferController): else: dlg = widgetUtils.YES if dlg == widgetUtils.YES: - self.timer.cancel() + if self.session.db.has_key(self.name): + self.session.db.pop(self.name) return True elif dlg == widgetUtils.NO: return False diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 487e9ab6..0eaf7f40 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -987,6 +987,10 @@ class Controller(object): buff = self.view.search(buffer.name, buffer.account) answer = buffer.remove_buffer() if answer == False: return + if hasattr(buff, "timer"): + log.debug("Stopping timer...") + buff.timer.cancel() + log.debug("Timer cancelled.") self.right() self.view.delete_buffer(buff) buffer.session.sound.play("delete_timeline.ogg")