Here are the examples of the csharp api System.GC.SuppressFinalize(object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2560 Examples
19
View Source File : DataContext.cs
License : MIT License
Project Creator : 0x0ade
License : MIT License
Project Creator : 0x0ade
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : Lock.cs
License : MIT License
Project Creator : 0x0ade
License : MIT License
Project Creator : 0x0ade
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : Disposable.cs
License : GNU Lesser General Public License v3.0
Project Creator : 0xC0000054
License : GNU Lesser General Public License v3.0
Project Creator : 0xC0000054
public void Dispose()
{
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
19
View Source File : AvifItemData.cs
License : MIT License
Project Creator : 0xC0000054
License : MIT License
Project Creator : 0xC0000054
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
19
View Source File : DbContext.cs
License : MIT License
Project Creator : 2881099
License : MIT License
Project Creator : 2881099
public void Dispose() {
if (_isdisposed) return;
try {
_actions.Clear();
foreach (var set in _dicSet)
try {
set.Value.Dispose();
} catch { }
_dicSet.Clear();
AllSets.Clear();
_uow?.Rollback();
} finally {
_isdisposed = true;
GC.SuppressFinalize(this);
}
}
19
View Source File : DbSet.cs
License : MIT License
Project Creator : 2881099
License : MIT License
Project Creator : 2881099
public void Dispose() {
if (_isdisposed) return;
try {
this._dicUpdateTimes.Clear();
this._states.Clear();
} finally {
_isdisposed = true;
GC.SuppressFinalize(this);
}
}
19
View Source File : BaseRepository.cs
License : MIT License
Project Creator : 2881099
License : MIT License
Project Creator : 2881099
public void Dispose() {
if (_isdisposed) return;
try {
_dbsetPriv?.Dispose();
_dbPriv?.Dispose();
this.DataFilter.Dispose();
} finally {
_isdisposed = true;
GC.SuppressFinalize(this);
}
}
19
View Source File : UnitOfWork.cs
License : MIT License
Project Creator : 2881099
License : MIT License
Project Creator : 2881099
public void Dispose() {
if (_isdisposed) return;
try {
this.Rollback();
} finally {
_isdisposed = true;
GC.SuppressFinalize(this);
}
}
19
View Source File : Job.cs
License : GNU General Public License v3.0
Project Creator : 2dust
License : GNU General Public License v3.0
Project Creator : 2dust
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : BaseDomainService.cs
License : GNU Lesser General Public License v3.0
Project Creator : 8720826
License : GNU Lesser General Public License v3.0
Project Creator : 8720826
public void Dispose()
{
GC.SuppressFinalize(this);
}
19
View Source File : UnitOfWork.cs
License : GNU Lesser General Public License v3.0
Project Creator : 8720826
License : GNU Lesser General Public License v3.0
Project Creator : 8720826
public void Dispose()
{
if (_context != null)
{
_context.Dispose();
}
GC.SuppressFinalize(this);
}
19
View Source File : BTCChinaWebSocketApi.cs
License : MIT License
Project Creator : aabiryukov
License : MIT License
Project Creator : aabiryukov
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : OculusMirrorTexture.cs
License : MIT License
Project Creator : ab4d
License : MIT License
Project Creator : ab4d
protected virtual void Dispose(bool disposing)
{
if (IsDisposed)
return;
if (MirrorTexturePtr != IntPtr.Zero)
{
_ovr.DestroyMirrorTexture(_sessionPtr, MirrorTexturePtr);
MirrorTexturePtr = IntPtr.Zero;
}
GC.SuppressFinalize(this);
IsDisposed = true;
}
19
View Source File : OculusTextureSwapChain.cs
License : MIT License
Project Creator : ab4d
License : MIT License
Project Creator : ab4d
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize((object)this);
}
19
View Source File : MirrorTexture.cs
License : MIT License
Project Creator : ab4d
License : MIT License
Project Creator : ab4d
protected virtual void Dispose(bool disposing)
{
if(IsDisposed)
return;
if(MirrorTexturePtr != IntPtr.Zero)
{
_ovr.DestroyMirrorTexture(_sessionPtr, MirrorTexturePtr);
MirrorTexturePtr = IntPtr.Zero;
// Notify subscribers that this object has been disposed.
if(Disposed != null)
Disposed(this);
}
GC.SuppressFinalize(this);
IsDisposed = true;
}
19
View Source File : TextureSwapChain.cs
License : MIT License
Project Creator : ab4d
License : MIT License
Project Creator : ab4d
protected virtual void Dispose(bool disposing)
{
if(IsDisposed)
return;
if(TextureSwapChainPtr != IntPtr.Zero)
{
_ovr.DestroyTextureSwapChain(_sessionPtr, TextureSwapChainPtr);
TextureSwapChainPtr = IntPtr.Zero;
// Notify subscribers that this object has been disposed.
if(Disposed != null)
Disposed(this);
}
GC.SuppressFinalize(this);
IsDisposed = true;
}
19
View Source File : GUIEnabledWrapper.cs
License : Apache License 2.0
Project Creator : abist-co-ltd
License : Apache License 2.0
Project Creator : abist-co-ltd
public void Dispose()
{
// Dispose of unmanaged resources.
Dispose(true);
// Suppress finalization.
GC.SuppressFinalize(this);
}
19
View Source File : BaseService.cs
License : Apache License 2.0
Project Creator : abist-co-ltd
License : Apache License 2.0
Project Creator : abist-co-ltd
public void Dispose()
{
// Clean up our resources (managed and unmanaged resources)
Dispose(true);
// Suppress finalization as the finalizer also calls our cleanup code.
GC.SuppressFinalize(this);
}
19
View Source File : Packet.cs
License : MIT License
Project Creator : absurd-joy
License : MIT License
Project Creator : absurd-joy
public void Dispose()
{
CAPI.ovr_Packet_Free(packetHandle);
GC.SuppressFinalize(this);
}
19
View Source File : OVRCommon.cs
License : MIT License
Project Creator : absurd-joy
License : MIT License
Project Creator : absurd-joy
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : BasePage.cs
License : Apache License 2.0
Project Creator : acblog
License : Apache License 2.0
Project Creator : acblog
public virtual void Dispose()
{
NavigationManager.LocationChanged -= LocationChanged;
GC.SuppressFinalize(this);
}
19
View Source File : HostContext.cs
License : MIT License
Project Creator : actions
License : MIT License
Project Creator : actions
public override void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : IssuedTokenProvider.cs
License : MIT License
Project Creator : actions
License : MIT License
Project Creator : actions
public void Dispose()
{
if (m_disposed)
{
return;
}
TraceErrorIfNotCompleted();
m_disposed = true;
GC.SuppressFinalize(this);
}
19
View Source File : CodeGenerator.partial.cs
License : BSD 2-Clause "Simplified" License
Project Creator : adospace
License : BSD 2-Clause "Simplified" License
Project Creator : adospace
public void Dispose()
{
// Do not change this code. Put cleanup code in Dispose(bool disposing) above.
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : BaseManager.cs
License : MIT License
Project Creator : Adoxio
License : MIT License
Project Creator : Adoxio
public virtual void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : SimpleAudioPlayerImplementation.cs
License : MIT License
Project Creator : adrianstevens
License : MIT License
Project Creator : adrianstevens
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : SimpleAudioPlayerImplementation.cs
License : MIT License
Project Creator : adrianstevens
License : MIT License
Project Creator : adrianstevens
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : Parallel.cs
License : MIT License
Project Creator : adrenak
License : MIT License
Project Creator : adrenak
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : Parallel.cs
License : MIT License
Project Creator : adrenak
License : MIT License
Project Creator : adrenak
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : Parallel.cs
License : MIT License
Project Creator : adrenak
License : MIT License
Project Creator : adrenak
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : Parallel.cs
License : MIT License
Project Creator : adrenak
License : MIT License
Project Creator : adrenak
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : Parallel.cs
License : MIT License
Project Creator : adrenak
License : MIT License
Project Creator : adrenak
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : HtmlHelpers.cs
License : Apache License 2.0
Project Creator : advanced-cms
License : Apache License 2.0
Project Creator : advanced-cms
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : FolderInfoPanel.xaml.cs
License : MIT License
Project Creator : adyanth
License : MIT License
Project Creator : adyanth
public void Dispose()
{
GC.SuppressFinalize(this);
_disposed = true;
fileListView.Dispose();
}
19
View Source File : Plugin.cs
License : MIT License
Project Creator : adyanth
License : MIT License
Project Creator : adyanth
public void Cleanup()
{
GC.SuppressFinalize(this);
_panel.Stop = true;
_panel?.Dispose();
_panel = null;
}
19
View Source File : GUIBase.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
public MovieTexture LoadVideo(string namebase)
{
MovieTexture tex;
string name = namebase;
string path = Directory + name + ".ogv";
if (!File.Exists(path))
{
Debug.LogError($"File what you are trying to load doesnt't exist: \"{path}\"");
return null;
}
WWW www = new WWW("file://" + path);
if (www.texture == null)
{
Debug.LogError($"Null texture");
www.Dispose();
GC.SuppressFinalize(www);
return null;
}
tex = www.movie;
www.Dispose();
GC.SuppressFinalize(www);
return tex;
}
19
View Source File : UnmanagedBuffer.cs
License : Apache License 2.0
Project Creator : aequabit
License : Apache License 2.0
Project Creator : aequabit
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : Server.cs
License : Apache License 2.0
Project Creator : aequabit
License : Apache License 2.0
Project Creator : aequabit
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : ParallelLoopWorker.cs
License : The Unlicense
Project Creator : aeroson
License : The Unlicense
Project Creator : aeroson
public void Dispose()
{
lock (disposedLocker)
{
if (!disposed)
{
disposed = true;
getToWork.Close();
getToWork = null;
thread = null;
GC.SuppressFinalize(this);
}
}
}
19
View Source File : SpecializedThreadManager.cs
License : The Unlicense
Project Creator : aeroson
License : The Unlicense
Project Creator : aeroson
public void Dispose()
{
lock (disposedLocker)
{
if (!disposed)
{
disposed = true;
taskManager.Dispose();
looper.Dispose();
GC.SuppressFinalize(this);
}
}
}
19
View Source File : SimpleLooper.cs
License : The Unlicense
Project Creator : aeroson
License : The Unlicense
Project Creator : aeroson
public void Dispose()
{
lock (disposedLocker)
{
if (!disposed)
{
disposed = true;
ShutDown();
allThreadsIdleNotifier.Close();
GC.SuppressFinalize(this);
}
}
}
19
View Source File : ParallelLooper.cs
License : The Unlicense
Project Creator : aeroson
License : The Unlicense
Project Creator : aeroson
public void Dispose()
{
lock (disposedLocker)
{
if (!disposed)
{
disposed = true;
while (workers.Count > 0)
{
RemoveThread();
}
loopFinished.Close();
GC.SuppressFinalize(this);
}
}
}
19
View Source File : ThreadTaskManager.cs
License : The Unlicense
Project Creator : aeroson
License : The Unlicense
Project Creator : aeroson
public void Dispose()
{
lock (disposedLocker)
{
if (!disposed)
{
disposed = true;
resetEvent.Close();
resetEvent = null;
manager.workers.Remove(this);
GC.SuppressFinalize(this);
}
}
}
19
View Source File : SimpleLooper.cs
License : The Unlicense
Project Creator : aeroson
License : The Unlicense
Project Creator : aeroson
public void Dispose()
{
lock (disposedLocker)
{
if (!disposed)
{
disposed = true;
ShutDownThread();
resetEvent.Close();
GC.SuppressFinalize(this);
}
}
}
19
View Source File : GuiderImpl.cs
License : MIT License
Project Creator : agalasso
License : MIT License
Project Creator : agalasso
public void Close()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : GuiderImpl.cs
License : MIT License
Project Creator : agalasso
License : MIT License
Project Creator : agalasso
public override void Close()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : SocketAsyncPool.cs
License : Mozilla Public License 2.0
Project Creator : agebullhu
License : Mozilla Public License 2.0
Project Creator : agebullhu
public void Dispose()
{
Array.Clear(_buffer, 0, _buffer.Length);
GC.SuppressFinalize(_buffer);
while(_pool.Any())
_pool.Pop().Dispose();
try { _acquisitionGate.Release(); } catch { }
}
19
View Source File : ScopeBase.cs
License : Mozilla Public License 2.0
Project Creator : agebullhu
License : Mozilla Public License 2.0
Project Creator : agebullhu
public void DoDispose()
{
if (IsDisposed)
return;
IsDisposed = true;
OnDispose();
GC.SuppressFinalize(this);
}
19
View Source File : ZThread.cs
License : Mozilla Public License 2.0
Project Creator : agebullhu
License : Mozilla Public License 2.0
Project Creator : agebullhu
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
View Source File : MemoryCheck.cs
License : Mozilla Public License 2.0
Project Creator : agebullhu
License : Mozilla Public License 2.0
Project Creator : agebullhu
public void Dispose()
{
if (_isDisposed > 0)
return;
_isDisposed = 1;
#if UNMANAGE_MONEY_CHECK
SetIsFree(TypeName);
#endif
DoDispose();
GC.SuppressFinalize(this);
}
See More Examples