Correctly remove timeout source
Set source IDs to None after removing the source except when shutting down, because the Control ist destroyed anyway Only try to remove if we have a source ID
This commit is contained in:
parent
81566df8a1
commit
850e273605
2 changed files with 12 additions and 4 deletions
|
@ -520,7 +520,9 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
super(ChatControlBase, self).shutdown()
|
super(ChatControlBase, self).shutdown()
|
||||||
# Disconnect timer callbacks
|
# Disconnect timer callbacks
|
||||||
|
if self.possible_paused_timeout_id:
|
||||||
GLib.source_remove(self.possible_paused_timeout_id)
|
GLib.source_remove(self.possible_paused_timeout_id)
|
||||||
|
if self.possible_inactive_timeout_id:
|
||||||
GLib.source_remove(self.possible_inactive_timeout_id)
|
GLib.source_remove(self.possible_inactive_timeout_id)
|
||||||
# PluginSystem: removing GUI extension points connected with ChatControlBase
|
# PluginSystem: removing GUI extension points connected with ChatControlBase
|
||||||
# instance object
|
# instance object
|
||||||
|
@ -803,6 +805,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
|
||||||
jid = contact.jid
|
jid = contact.jid
|
||||||
current_state = contact.our_chatstate
|
current_state = contact.our_chatstate
|
||||||
if current_state is False: # jid doesn't support chatstates
|
if current_state is False: # jid doesn't support chatstates
|
||||||
|
self.possible_paused_timeout_id = None
|
||||||
return False # stop looping
|
return False # stop looping
|
||||||
|
|
||||||
message_buffer = self.msg_textview.get_buffer()
|
message_buffer = self.msg_textview.get_buffer()
|
||||||
|
@ -832,6 +835,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
|
||||||
|
|
||||||
current_state = contact.our_chatstate
|
current_state = contact.our_chatstate
|
||||||
if current_state is False: # jid doesn't support chatstates
|
if current_state is False: # jid doesn't support chatstates
|
||||||
|
self.possible_inactive_timeout_id = None
|
||||||
return False # stop looping
|
return False # stop looping
|
||||||
|
|
||||||
if self.mouse_over_in_last_5_secs or self.kbd_activity_in_last_5_secs:
|
if self.mouse_over_in_last_5_secs or self.kbd_activity_in_last_5_secs:
|
||||||
|
|
|
@ -2086,8 +2086,12 @@ class GroupchatControl(ChatControlBase):
|
||||||
control = win.notebook.get_nth_page(ctrl_page)
|
control = win.notebook.get_nth_page(ctrl_page)
|
||||||
|
|
||||||
win.notebook.remove_page(ctrl_page)
|
win.notebook.remove_page(ctrl_page)
|
||||||
|
if self.possible_paused_timeout_id:
|
||||||
GLib.source_remove(self.possible_paused_timeout_id)
|
GLib.source_remove(self.possible_paused_timeout_id)
|
||||||
|
self.possible_paused_timeout_id = None
|
||||||
|
if self.possible_inactive_timeout_id:
|
||||||
GLib.source_remove(self.possible_inactive_timeout_id)
|
GLib.source_remove(self.possible_inactive_timeout_id)
|
||||||
|
self.possible_inactive_timeout_id = None
|
||||||
control.unparent()
|
control.unparent()
|
||||||
ctrl.parent_win = None
|
ctrl.parent_win = None
|
||||||
self.send_chatstate('inactive', self.contact)
|
self.send_chatstate('inactive', self.contact)
|
||||||
|
|
Loading…
Add table
Reference in a new issue