private IValue _PopReturnValue(long return_target) { IValue val = null; if (_ReturnValues.TryGetValue(return_target, out val)) { _ReturnValues.Remove(return_target); _IdLandlord.Return(return_target); } return(val); }
private void _Unbind(object soul, Type type, long passage) { Soul soulInfo = (from soul_info in _Souls.UpdateSet() where object.ReferenceEquals(soul_info.ObjectInstance, soul) && soul_info.ObjectType == type select soul_info).SingleOrDefault(); if (soulInfo != null) { soulInfo.Release(); _UnloadSoul(soulInfo.InterfaceId, soulInfo.Id, passage); _Souls.Remove(s => { return(s == soulInfo); }); _IdLandlord.Return(soulInfo.Id); } }
private void _Unbind(ISoul soul) { SoulProxy soulInfo; //Regulus.Utility.Log.Instance.WriteInfoImmediate($"unbind i:{soul.Instance.GetHashCode()} t:{soul.Instance.GetType()} id:{soul.Id}."); if (!_Souls.TryRemove(soul.Id, out soulInfo)) { throw new Exception($"can't find the soul {soul.Id} to delete."); } soulInfo.Release(); soulInfo.SupplySoulEvent -= _PropertyBind; soulInfo.UnsupplySoulEvent -= _PropertyUnbind; _UnloadSoul(soulInfo.InterfaceId, soulInfo.Id); _IdLandlord.Return(soulInfo.Id); }