From 9c5dde7b2ec28c555488eee7dec81bb1f612c443 Mon Sep 17 00:00:00 2001 From: walker Date: Tue, 23 Jan 2024 10:43:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=8D=E7=AD=89=E4=BA=8Eni?= =?UTF-8?q?l=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- world.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 + } } // 执行待处理方法