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
Source : DataContext.cs
with MIT License
from 0x0ade
with MIT License
from 0x0ade
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : Lock.cs
with MIT License
from 0x0ade
with MIT License
from 0x0ade
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : Disposable.cs
with GNU Lesser General Public License v3.0
from 0xC0000054
with GNU Lesser General Public License v3.0
from 0xC0000054
public void Dispose()
{
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
19
Source : AvifItemData.cs
with MIT License
from 0xC0000054
with MIT License
from 0xC0000054
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
19
Source : DbContext.cs
with MIT License
from 2881099
with MIT License
from 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
Source : DbSet.cs
with MIT License
from 2881099
with MIT License
from 2881099
public void Dispose() {
if (_isdisposed) return;
try {
this._dicUpdateTimes.Clear();
this._states.Clear();
} finally {
_isdisposed = true;
GC.SuppressFinalize(this);
}
}
19
Source : BaseRepository.cs
with MIT License
from 2881099
with MIT License
from 2881099
public void Dispose() {
if (_isdisposed) return;
try {
_dbsetPriv?.Dispose();
_dbPriv?.Dispose();
this.DataFilter.Dispose();
} finally {
_isdisposed = true;
GC.SuppressFinalize(this);
}
}
19
Source : UnitOfWork.cs
with MIT License
from 2881099
with MIT License
from 2881099
public void Dispose() {
if (_isdisposed) return;
try {
this.Rollback();
} finally {
_isdisposed = true;
GC.SuppressFinalize(this);
}
}
19
Source : Job.cs
with GNU General Public License v3.0
from 2dust
with GNU General Public License v3.0
from 2dust
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : BaseDomainService.cs
with GNU Lesser General Public License v3.0
from 8720826
with GNU Lesser General Public License v3.0
from 8720826
public void Dispose()
{
GC.SuppressFinalize(this);
}
19
Source : UnitOfWork.cs
with GNU Lesser General Public License v3.0
from 8720826
with GNU Lesser General Public License v3.0
from 8720826
public void Dispose()
{
if (_context != null)
{
_context.Dispose();
}
GC.SuppressFinalize(this);
}
19
Source : BTCChinaWebSocketApi.cs
with MIT License
from aabiryukov
with MIT License
from aabiryukov
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : OculusMirrorTexture.cs
with MIT License
from ab4d
with MIT License
from 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
Source : OculusTextureSwapChain.cs
with MIT License
from ab4d
with MIT License
from ab4d
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize((object)this);
}
19
Source : MirrorTexture.cs
with MIT License
from ab4d
with MIT License
from 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
Source : TextureSwapChain.cs
with MIT License
from ab4d
with MIT License
from 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
Source : GUIEnabledWrapper.cs
with Apache License 2.0
from abist-co-ltd
with Apache License 2.0
from abist-co-ltd
public void Dispose()
{
// Dispose of unmanaged resources.
Dispose(true);
// Suppress finalization.
GC.SuppressFinalize(this);
}
19
Source : BaseService.cs
with Apache License 2.0
from abist-co-ltd
with Apache License 2.0
from 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
Source : Packet.cs
with MIT License
from absurd-joy
with MIT License
from absurd-joy
public void Dispose()
{
CAPI.ovr_Packet_Free(packetHandle);
GC.SuppressFinalize(this);
}
19
Source : OVRCommon.cs
with MIT License
from absurd-joy
with MIT License
from absurd-joy
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : BasePage.cs
with Apache License 2.0
from acblog
with Apache License 2.0
from acblog
public virtual void Dispose()
{
NavigationManager.LocationChanged -= LocationChanged;
GC.SuppressFinalize(this);
}
19
Source : HostContext.cs
with MIT License
from actions
with MIT License
from actions
public override void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : IssuedTokenProvider.cs
with MIT License
from actions
with MIT License
from actions
public void Dispose()
{
if (m_disposed)
{
return;
}
TraceErrorIfNotCompleted();
m_disposed = true;
GC.SuppressFinalize(this);
}
19
Source : CodeGenerator.partial.cs
with BSD 2-Clause "Simplified" License
from adospace
with BSD 2-Clause "Simplified" License
from adospace
public void Dispose()
{
// Do not change this code. Put cleanup code in Dispose(bool disposing) above.
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : BaseManager.cs
with MIT License
from Adoxio
with MIT License
from Adoxio
public virtual void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : SimpleAudioPlayerImplementation.cs
with MIT License
from adrianstevens
with MIT License
from adrianstevens
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : SimpleAudioPlayerImplementation.cs
with MIT License
from adrianstevens
with MIT License
from adrianstevens
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : Parallel.cs
with MIT License
from adrenak
with MIT License
from adrenak
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : Parallel.cs
with MIT License
from adrenak
with MIT License
from adrenak
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : Parallel.cs
with MIT License
from adrenak
with MIT License
from adrenak
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : Parallel.cs
with MIT License
from adrenak
with MIT License
from adrenak
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : Parallel.cs
with MIT License
from adrenak
with MIT License
from adrenak
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : HtmlHelpers.cs
with Apache License 2.0
from advanced-cms
with Apache License 2.0
from advanced-cms
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : FolderInfoPanel.xaml.cs
with MIT License
from adyanth
with MIT License
from adyanth
public void Dispose()
{
GC.SuppressFinalize(this);
_disposed = true;
fileListView.Dispose();
}
19
Source : Plugin.cs
with MIT License
from adyanth
with MIT License
from adyanth
public void Cleanup()
{
GC.SuppressFinalize(this);
_panel.Stop = true;
_panel?.Dispose();
_panel = null;
}
19
Source : GUIBase.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from 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
Source : UnmanagedBuffer.cs
with Apache License 2.0
from aequabit
with Apache License 2.0
from aequabit
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : Server.cs
with Apache License 2.0
from aequabit
with Apache License 2.0
from aequabit
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : ParallelLoopWorker.cs
with The Unlicense
from aeroson
with The Unlicense
from aeroson
public void Dispose()
{
lock (disposedLocker)
{
if (!disposed)
{
disposed = true;
getToWork.Close();
getToWork = null;
thread = null;
GC.SuppressFinalize(this);
}
}
}
19
Source : SpecializedThreadManager.cs
with The Unlicense
from aeroson
with The Unlicense
from aeroson
public void Dispose()
{
lock (disposedLocker)
{
if (!disposed)
{
disposed = true;
taskManager.Dispose();
looper.Dispose();
GC.SuppressFinalize(this);
}
}
}
19
Source : SimpleLooper.cs
with The Unlicense
from aeroson
with The Unlicense
from aeroson
public void Dispose()
{
lock (disposedLocker)
{
if (!disposed)
{
disposed = true;
ShutDown();
allThreadsIdleNotifier.Close();
GC.SuppressFinalize(this);
}
}
}
19
Source : ParallelLooper.cs
with The Unlicense
from aeroson
with The Unlicense
from aeroson
public void Dispose()
{
lock (disposedLocker)
{
if (!disposed)
{
disposed = true;
while (workers.Count > 0)
{
RemoveThread();
}
loopFinished.Close();
GC.SuppressFinalize(this);
}
}
}
19
Source : ThreadTaskManager.cs
with The Unlicense
from aeroson
with The Unlicense
from aeroson
public void Dispose()
{
lock (disposedLocker)
{
if (!disposed)
{
disposed = true;
resetEvent.Close();
resetEvent = null;
manager.workers.Remove(this);
GC.SuppressFinalize(this);
}
}
}
19
Source : SimpleLooper.cs
with The Unlicense
from aeroson
with The Unlicense
from aeroson
public void Dispose()
{
lock (disposedLocker)
{
if (!disposed)
{
disposed = true;
ShutDownThread();
resetEvent.Close();
GC.SuppressFinalize(this);
}
}
}
19
Source : GuiderImpl.cs
with MIT License
from agalasso
with MIT License
from agalasso
public void Close()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : GuiderImpl.cs
with MIT License
from agalasso
with MIT License
from agalasso
public override void Close()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : SocketAsyncPool.cs
with Mozilla Public License 2.0
from agebullhu
with Mozilla Public License 2.0
from agebullhu
public void Dispose()
{
Array.Clear(_buffer, 0, _buffer.Length);
GC.SuppressFinalize(_buffer);
while(_pool.Any())
_pool.Pop().Dispose();
try { _acquisitionGate.Release(); } catch { }
}
19
Source : ScopeBase.cs
with Mozilla Public License 2.0
from agebullhu
with Mozilla Public License 2.0
from agebullhu
public void DoDispose()
{
if (IsDisposed)
return;
IsDisposed = true;
OnDispose();
GC.SuppressFinalize(this);
}
19
Source : ZThread.cs
with Mozilla Public License 2.0
from agebullhu
with Mozilla Public License 2.0
from agebullhu
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
19
Source : MemoryCheck.cs
with Mozilla Public License 2.0
from agebullhu
with Mozilla Public License 2.0
from agebullhu
public void Dispose()
{
if (_isDisposed > 0)
return;
_isDisposed = 1;
#if UNMANAGE_MONEY_CHECK
SetIsFree(TypeName);
#endif
DoDispose();
GC.SuppressFinalize(this);
}
See More Examples