System.GC.SuppressFinalize(object)

Here are the examples of the csharp api class System.GC.SuppressFinalize(object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

200 Examples 7

1. Example

Project: TraceLab
Source File: PassiveWeakDictionary.cs
private WeakReference AllocWeakRef(TKey key)
		{
			WeakReference weakRef;
			if (freeList != null)
			{
				weakRef = freeList.WeakRef;
				freeList = freeList.Next;
				freeCount--;
				weakRef.Target = key;
			}
			else
			{
				weakRef = new WeakReference(key, true);
				GC.SuppressFinalize(weakRef);
			}
			return weakRef;
		}

2. Example

Project: TraceLab
Source File: ColumnHeaderCollection.cs
public void Dispose()
        {
            GC.SuppressFinalize(this);
            if (_columns != null)
            {
                _columns.CollectionChanged -= OnColumnsChanged;
            }
        }

3. Example

Project: TraceLab
Source File: ColumnHeaderCollection.cs
public void Dispose()
            {
                GC.SuppressFinalize(this);
                if (_columns != null)
                {
                    _columns.CollectionChanged -= OnColumnsChanged;
                }
            }

4. Example

Project: TraceLab
Source File: ExperimentRunner.cs
public void Dispose()
        {
            GC.SuppressFinalize(this);
        }

5. Example

Project: More
Source File: UnitOfWorkTest.cs
public void Dispose()
        {
            UnitOfWork.Provider = originalProvider;
            GC.SuppressFinalize( this );
        }

6. Example

Project: More
Source File: WindowAction.CommandMediator.cs
public void Dispose()
            {
                if ( commands != null )
                    commands.ForEach( c => c.Executed -= OnExecuted );

                if ( window != null )
                    window.Closing -= OnWindowClosing;

                commands = null;
                window = null;
                GC.SuppressFinalize( this );
            }

7. Example

Project: More
Source File: SearchContractBehavior.cs
public void Dispose()
            {
                if ( disposed )
                    return;

                disposed = true;

                if ( deferral != null )
                {
                    deferral.Complete();
                    deferral = null;
                }

                GC.SuppressFinalize( this );
            }

8. Example

Project: Krypton
Source File: DragFeedback.cs
protected virtual void Dispose(bool disposing)
		{
			// If called from explicit call to Dispose
			if (disposing)
			{
				// No need to call destructor once dispose has occured
				GC.SuppressFinalize(this);

                _pageDragEndData = null;
                _dragTargets = null;
			}

			// Mark as disposed
			_disposed = true;
		}

9. Example

Project: Krypton
Source File: DragTarget.cs
protected virtual void Dispose(bool disposing)
		{
			// If called from explicit call to Dispose
			if (disposing)
			{
				// No need to call destructor once dispose has occured
				GC.SuppressFinalize(this);
			}

			// Mark as disposed
			_disposed = true;
		}

10. Example

Project: Krypton
Source File: RenderMementos.cs
public virtual void Dispose(bool disposing)
        {
            // If called manully, no need to use a finalize call to dispose
            if (disposing)
                GC.SuppressFinalize(this);

            _disposed = true;
        }

11. Example

Project: Krypton
Source File: ViewBase.cs
protected virtual void Dispose(bool disposing)
		{
			// If called from explicit call to Dispose
			if (disposing)
			{
                // Remove reference to parent view
                _parent = null;

                // No need to call destructor once dispose has occured
				GC.SuppressFinalize(this);
			}

			// Mark as disposed
			_disposed = true;
		}

12. Example

Project: ContinuousTests
Source File: TestExceptionHandler.cs
public void Dispose()
		{
			if ( handler != null )
			{
				AppDomain.CurrentDomain.UnhandledException -= handler;
				handler = null;
			}

			System.GC.SuppressFinalize( this );
		}

13. Example

Project: ContinuousTests
Source File: TestExceptionHandler.cs
public void Dispose()
		{
			if ( handler != null )
			{
				AppDomain.CurrentDomain.UnhandledException -= handler;
				handler = null;
			}

			System.GC.SuppressFinalize( this );
		}

14. Example

Project: ContinuousTests
Source File: TestExceptionHandler.cs
public void Dispose()
		{
			if ( handler != null )
			{
				AppDomain.CurrentDomain.UnhandledException -= handler;
				handler = null;
			}

			System.GC.SuppressFinalize( this );
		}

15. Example

Project: IL2CPU
Source File: SqliteBulkCopy.cs
public void Dispose()
        {
            if (mDisposed)
            {
                return;
            }
            mDisposed = true;
            GC.SuppressFinalize(this);
        }

16. Example

Project: couchbase-net-client
Source File: PooledIOService.cs
void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    GC.SuppressFinalize(this);
                }
                ConnectionPool?.Dispose();
            }
            _disposed = true;
        }

17. Example

Project: couchbase-net-client
Source File: Cluster.cs
void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    GC.SuppressFinalize(this);
                }
                if (_clusterController != null)
                {
                    _clusterController.Dispose();
                }
                _disposed = true;
            }
        }

18. Example

Project: couchbase-net-client
Source File: CouchbaseBucket.cs
void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                Log.Debug("Disposing on thread {0}", Thread.CurrentThread.ManagedThreadId);
                if (_clusterController != null)
                {
                    _clusterController.DestroyBucket(this);
                }
                if (disposing)
                {
                    GC.SuppressFinalize(this);
                }
                _disposed = true;
            }
        }

19. Example

Project: couchbase-net-client
Source File: MemcachedBucket.cs
void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                _clusterController.DestroyBucket(this);
                if (disposing)
                {
                    GC.SuppressFinalize(this);
                }
                _disposed = true;
            }
        }

20. Example

Project: Astrid.Framework
Source File: Body.cs
public void Dispose()
        {
            if (!IsDisposed)
            {
                _world.RemoveBody(this);
                IsDisposed = true;
                GC.SuppressFinalize(this);
            }
        }

21. Example

Project: Astrid.Framework
Source File: Fixture.cs
public void Dispose()
        {
            if (!IsDisposed)
            {
                Body.DestroyFixture(this);
                IsDisposed = true;
                GC.SuppressFinalize(this);
            }
        }

22. Example

Project: MonoGame.Extended
Source File: ParticleEmitter.cs
public void Dispose()
        {
            Buffer.Dispose();
            GC.SuppressFinalize(this);
        }

23. Example

Project: modernizeWebForms
Source File: TripRepository.cs
protected virtual void Dispose(bool isDisposing)
    {

			if (isDisposing) GC.SuppressFinalize(this);

			_Context.Dispose();

		}

24. Example

Project: Cyjb.Compilers
Source File: RegexParser.cs
public void Dispose()
		{
			if (pattern != null)
			{
				// ?? SourceReader ??????????????
				reader.Dispose();
			}
			GC.SuppressFinalize(this);
		}

25. Example

Project: RaspberryPi.Net
Source File: RaspPiGPIOFileLcdTransferProvider.cs
private void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                _rsPort.Dispose();
                _rwPort.Dispose();
                _enablePort.Dispose();

                for (int i = 0; i < 8; i++)
                {
                    if (_dataPorts[i] != null)
                        _dataPorts[i].Dispose();
                }
                _disposed = true;
            }
            
            if (disposing)
            {
                GC.SuppressFinalize(this);
            }
        }

26. Example

Project: RaspberryPi.Net
Source File: RaspPiGPIOMemLcdTransferProvider.cs
private void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                _rsPort.Dispose();
                _rwPort.Dispose();
                _enablePort.Dispose();

                for (int i = 0; i < 8; i++)
                {
                    if (_dataPorts[i] != null)
                        _dataPorts[i].Dispose();
                }
                _disposed = true;
            }
            
            if (disposing)
            {
                GC.SuppressFinalize(this);
            }
        }

27. Example

Project: ImageGlass
Source File: ImageListViewCacheMetadata.cs
public void Dispose ()
		{
			if (!disposed) {
				bw.DoWork -= bw_DoWork;
				bw.RunWorkerCompleted -= bw_RunWorkerCompleted;
				
				bw.Dispose ();
				
				disposed = true;
				
				GC.SuppressFinalize (this);
			}
		}

28. Example

Project: HoloViveObserver
Source File: AnchorDownloadRequest.cs
public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_AnchorDownloadRequest(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
    }
  }

29. Example

Project: HoloViveObserver
Source File: AudioManager.cs
public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_AudioManager(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
    }
  }

30. Example

Project: HoloViveObserver
Source File: BoolElement.cs
public override void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_BoolElement(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

31. Example

Project: HoloViveObserver
Source File: ClientConfig.cs
public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_ClientConfig(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
    }
  }

32. Example

Project: HoloViveObserver
Source File: DirectPairConnector.cs
public override void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_DirectPairConnector(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

33. Example

Project: HoloViveObserver
Source File: DirectPairReceiver.cs
public override void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_DirectPairReceiver(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

34. Example

Project: HoloViveObserver
Source File: DiscoveredSystem.cs
public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_DiscoveredSystem(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
    }
  }

35. Example

Project: HoloViveObserver
Source File: DiscoveryClient.cs
public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_DiscoveryClient(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
    }
  }

36. Example

Project: HoloViveObserver
Source File: DiscoveryClientListener.cs
public override void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_DiscoveryClientListener(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

37. Example

Project: HoloViveObserver
Source File: DoubleElement.cs
public override void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_DoubleElement(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

38. Example

Project: HoloViveObserver
Source File: Element.cs
public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_Element(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
    }
  }

39. Example

Project: HoloViveObserver
Source File: FloatElement.cs
public override void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_FloatElement(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

40. Example

Project: HoloViveObserver
Source File: ImageTagLocation.cs
public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_ImageTagLocation(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
    }
  }

41. Example

Project: HoloViveObserver
Source File: ImageTagLocationListener.cs
public override void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_ImageTagLocationListener(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

42. Example

Project: HoloViveObserver
Source File: ImageTagManager.cs
public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_ImageTagManager(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
    }
  }

43. Example

Project: HoloViveObserver
Source File: IntArrayElement.cs
public override void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_IntArrayElement(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

44. Example

Project: HoloViveObserver
Source File: IntArrayListener.cs
public override void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_IntArrayListener(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

45. Example

Project: HoloViveObserver
Source File: IntElement.cs
public override void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_IntElement(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

46. Example

Project: HoloViveObserver
Source File: Listener.cs
public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_Listener(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
    }
  }

47. Example

Project: HoloViveObserver
Source File: Log.cs
public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_Log(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
    }
  }

48. Example

Project: HoloViveObserver
Source File: LogManager.cs
public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_LogManager(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
    }
  }

49. Example

Project: HoloViveObserver
Source File: LogWriter.cs
public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_LogWriter(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
    }
  }

50. Example

Project: HoloViveObserver
Source File: LongElement.cs
public override void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SharingClientPINVOKE.delete_LongElement(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
      base.Dispose();
    }
  }