添加不等于nil判断

This commit is contained in:
walker 2024-01-23 10:43:40 +08:00
parent 8a028e6405
commit 9c5dde7b2e
1 changed files with 4 additions and 2 deletions

View File

@ -214,8 +214,10 @@ func (w *world) Close() {
w.updateState(WorldClosed)
return
}
w.cancel()
<-w.done
if w.cancel != nil {
w.cancel()
<-w.done
}
}
// 执行待处理方法