mirror of
https://github.com/u0u0/Quick-Cocos2dx-Community.git
synced 2026-06-20 15:16:12 +08:00
事件通知放到停止schedule之后。
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user