diff --git a/world.go b/world.go index 959b0bf..230e3d6 100644 --- a/world.go +++ b/world.go @@ -214,8 +214,10 @@ func (w *world) Close() { w.updateState(WorldClosed) return } - w.cancel() - <-w.done + if w.cancel != nil { + w.cancel() + <-w.done + } } // 执行待处理方法