コード例 #1
0
    /// <summary>
    ///
    /// </summary>
    private void assignment()
    {
        DisposableClass temp = d;

        temp.id = id++;
        temp.Dispose();         // **
    }
コード例 #2
0
        public void DisposeWeakEventSubscription_OnDisposedObject_DoesNotThrow()
        {
            var disposableClass = new DisposableClass();

            var subscription = new MvxWeakEventSubscription <DisposableClass>(disposableClass, "TestEvent", (s, e) =>
            {
            });

            disposableClass.Dispose();
            subscription.Dispose();
        }
コード例 #3
0
    private void GenerateUnusedDisposableData()
    {
        DisposableClass dc = null;

        m_References = new WeakReference[1];

        try
        {
            dc = new DisposableClass();
            m_References[0] = new WeakReference(dc);
        }
        finally
        {
            if (null != dc)
            {
                dc.Dispose();
            }
        }

        GC.Collect();
    }
コード例 #4
0
        public static void Start()
        {
            var disposableClass = new DisposableClass();

            disposableClass.Dispose();
        }
コード例 #5
0
    private void GenerateUnusedDisposableData()
    {
        DisposableClass dc = null;
        m_References = new WeakReference[1];

        try
        {
            dc = new DisposableClass();
            m_References[0] = new WeakReference(dc);
        }
        finally
        {
            if (null != dc)
            {
                dc.Dispose();
            }
        }

        GC.Collect();
    }