Esempio n. 1
0
        private static void objectDied(LifeTime lifeTime, int index)
        {
            // put a new fresh object instead;

            ObjectWrapper oWrapper = lifeTime as ObjectWrapper;

            oWrapper.CleanUp();

            oWrapper          = new ObjectWrapper(s_runFinalizer, oWrapper.IsPinned(), oWrapper.IsWeak());
            oWrapper.LifeTime = lifeTime.LifeTime;
            oWrapper.DataSize = lifeTime.LifeTime == LifeTimeENUM.Short ? s_shortDataSize : s_mediumDataSize;

            s_lifeTimeManager.AddObject(oWrapper, index);
        }
Esempio n. 2
0
        private static void objectDied(LifeTime lifeTime, int index)
        {
            // put a new fresh object instead;

            LifeTimeENUM lifeTimeEnum;

            lifeTimeEnum = lifeTime.LifeTime;

            ObjectWrapper oWrapper       = lifeTime as ObjectWrapper;
            bool          weakReferenced = oWrapper.IsWeak();
            bool          pinned         = oWrapper.IsPinned();

            if (pinned)
            {
                oWrapper.CleanUp();
            }

            oWrapper          = new ObjectWrapper(runFinalizer, pinned, weakReferenced);
            oWrapper.LifeTime = lifeTimeEnum;
            oWrapper.DataSize = lifeTime.LifeTime == LifeTimeENUM.Short ? shortDataSize : mediumDataSize;
            lifeTimeManager.AddObject(oWrapper, index);
        }