检查指针为空

This commit is contained in:
boyce
2019-07-30 19:43:49 +08:00
parent 34abb27947
commit 718e485dc7

View File

@@ -151,7 +151,18 @@ func (slf *BaseModule) releaseModule(moduleId uint32) bool {
}
func (slf *BaseModule) ReleaseModule(moduleId uint32) bool {
locker := slf.GetRoot().getBaseModule().getLocker()
pRoot := slf.GetRoot()
if pRoot == nil {
return false
}
baseModule := pRoot.getBaseModule()
if baseModule == nil {
return false
}
//locker := slf.GetRoot().getBaseModule().getLocker()
locker := baseModule.getLocker()
locker.Lock()
slf.releaseModule(moduleId)
locker.Unlock()