| 1325 | } |
| 1326 | |
| 1327 | func (r *Runtime) takeClassObjectIdentity(objectID int32) (classObjectIdentity, bool) { |
| 1328 | if r == nil || objectID == 0 { |
| 1329 | return classObjectIdentity{}, false |
| 1330 | } |
| 1331 | v, ok := r.classObjectRegistry.LoadAndDelete(objectID) |
| 1332 | if !ok { |
| 1333 | return classObjectIdentity{}, false |
| 1334 | } |
| 1335 | identity, ok := v.(classObjectIdentity) |
| 1336 | if !ok { |
| 1337 | return classObjectIdentity{}, false |
| 1338 | } |
| 1339 | if identity.contextID == 0 || identity.handleID <= 0 { |
| 1340 | return classObjectIdentity{}, false |
| 1341 | } |
| 1342 | |
| 1343 | if bucketValue, ok := r.classObjectIDsByCtx.Load(identity.contextID); ok { |
| 1344 | if bucket, ok := bucketValue.(*sync.Map); ok { |
| 1345 | bucket.Delete(objectID) |
| 1346 | } |
| 1347 | } |
| 1348 | |
| 1349 | return identity, true |
| 1350 | } |
| 1351 | |
| 1352 | func (r *Runtime) cleanupClassObjectIdentitiesByContext(contextID uint64) { |
| 1353 | if r == nil || contextID == 0 { |