Delete timer objects for buffers before destroying them

This commit is contained in:
Manuel Cortez 2017-06-15 08:26:30 -05:00
parent 2618e0ac90
commit adc45ae767
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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")