// TODO: Move to ServicedComponent static method public static void DeactivateObject(Object otp, bool disposing) { RealProxy rp = RemotingServices.GetRealProxy(otp); ServicedComponentProxy scp = rp as ServicedComponentProxy; DBG.Assert(scp != null, "CS.DeactivateObject called on a non-ServicedComponentProxy"); if (!scp.IsProxyDeactivated) { DBG.Assert(scp.HomeToken == Thunk.Proxy.GetCurrentContextToken(), "Deactivate called from wrong context"); if (scp.IsObjectPooled) { DBG.Info(DBG.SC, "CS.DeactivateObject calling ReconnectForPooling"); ReconnectForPooling(scp); } // this would wack the real server also so do this last DBG.Info(DBG.SC, "CS.DeactivateObject calling scp.DeactivateProxy"); scp.DeactivateProxy(disposing); } DBG.Assert(scp.IsProxyDeactivated, "scp not deactive"); }
public static void DeactivateObject(object otp, bool disposing) { ServicedComponentProxy realProxy = RemotingServices.GetRealProxy(otp) as ServicedComponentProxy; if (!realProxy.IsProxyDeactivated) { if (realProxy.IsObjectPooled) { ReconnectForPooling(realProxy); } realProxy.DeactivateProxy(disposing); } }