优化模块释放顺序

This commit is contained in:
duanhf2012
2024-12-11 18:31:37 +08:00
parent 16745b34f0
commit e3275e9f2a
2 changed files with 7 additions and 7 deletions

View File

@@ -264,12 +264,11 @@ func (s *Service) Release() {
}
}()
for i:=len(s.child)-1; i>=0; i-- {
s.ReleaseModule(s.child[i].GetModuleId())
}
if atomic.AddInt32(&s.isRelease, -1) == -1 {
s.self.OnRelease()
for i:=len(s.child)-1; i>=0; i-- {
s.ReleaseModule(s.child[i].GetModuleId())
}
}
}