【发布时间】:2018-05-02 14:23:24
【问题描述】:
当我需要我的程序的一部分时,使用
设置 GLib 超时功能self.timeout_id = GLib.timeout_add_seconds(refresh, self._check_price)
我用
def stop(self):
if self.timeout_id:
GLib.source_remove(self.timeout_id)
在尝试删除它之前确保这个timeout_id 仍然存在。
但我仍然不时收到这些讨厌的错误消息:
警告:尝试删除源 ID 443 时未找到它
GLib.source_remove(self.timeout_id)
怎么办?
【问题讨论】: