fix: 修复 server.Multiple 关闭服务器空指针异常

This commit is contained in:
kercylan98
2023-07-03 13:12:22 +08:00
parent 5f8cc1341e
commit 1136af4dd8
3 changed files with 16 additions and 4 deletions
+4
View File
@@ -48,6 +48,10 @@ func (slf *Pool[T]) Get() T {
return slf.generator()
}
func (slf *Pool[T]) IsClose() bool {
return slf.generator == nil
}
func (slf *Pool[T]) Release(data T) {
slf.releaser(data)
slf.put(data)