事件通知放到停止schedule之后。

This commit is contained in:
LiuKeNan
2017-07-31 14:20:27 +08:00
parent 5b726e7fb5
commit aa92b5e723

View File

@@ -163,11 +163,12 @@ function SimpleTCP:_update(dt)
else
self.connectingTime = self.connectingTime + dt
if self.connectingTime >= SimpleTCP.CONNECT_TIMEOUT then
self.stat = SimpleTCP.STAT_FAILED
self.callback(SimpleTCP.EVENT_FAILED)
-- stop scheduler
scheduler.unscheduleGlobal(self.globalUpdateHandler)
self.globalUpdateHandler = nil
-- notification
self.stat = SimpleTCP.STAT_FAILED
self.callback(SimpleTCP.EVENT_FAILED)
end
return
end