mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Move ShaderInstance finalizer around so DummyShaderInstance isn't finalized.
Maybe help a bit with test GC performance.
This commit is contained in:
@@ -393,7 +393,18 @@ namespace Robust.Client.Graphics.Clyde
|
||||
return new ClydeShaderInstance(newHandle, Parent);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
public override void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
~ClydeShaderInstance()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
Parent._deadShaderInstances.Enqueue(Handle);
|
||||
}
|
||||
|
||||
@@ -222,20 +222,10 @@ namespace Robust.Client.Graphics
|
||||
return DuplicateImpl();
|
||||
}
|
||||
|
||||
~ShaderInstance()
|
||||
#pragma warning disable CA1816
|
||||
public virtual void Dispose()
|
||||
#pragma warning restore CA1816
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
Disposed = true;
|
||||
}
|
||||
|
||||
private void EnsureMutable()
|
||||
|
||||
Reference in New Issue
Block a user