Just use Dispose methods without arguments (disposing always passed as true)

This commit is contained in:
KonH
2021-10-02 21:09:32 +07:00
committed by abcdefg30
parent 8bce6eb3ac
commit 9ed809943d
5 changed files with 3 additions and 30 deletions

View File

@@ -366,7 +366,7 @@ namespace OpenRA.Network
public string ErrorMessage => errorMessage; public string ErrorMessage => errorMessage;
void Dispose(bool disposing) void IDisposable.Dispose()
{ {
if (disposed) if (disposed)
return; return;
@@ -377,13 +377,7 @@ namespace OpenRA.Network
// This will mark the connection as no longer connected and the thread will terminate cleanly. // This will mark the connection as no longer connected and the thread will terminate cleanly.
tcp?.Close(); tcp?.Close();
if (disposing) Recorder?.Dispose();
Recorder?.Dispose();
}
void IDisposable.Dispose()
{
Dispose(true);
} }
} }
} }

View File

@@ -142,17 +142,11 @@ namespace OpenRA.Platforms.Default
} }
public void Dispose() public void Dispose()
{
Dispose(true);
}
void Dispose(bool disposing)
{ {
if (disposed) if (disposed)
return; return;
disposed = true; disposed = true;
if (disposing) texture.Dispose();
texture.Dispose();
OpenGL.glDeleteFramebuffers(1, ref framebuffer); OpenGL.glDeleteFramebuffers(1, ref framebuffer);
OpenGL.CheckGLError(); OpenGL.CheckGLError();

View File

@@ -45,11 +45,6 @@ namespace OpenRA.Platforms.Default
} }
public void Dispose() public void Dispose()
{
Dispose(true);
}
void Dispose(bool disposing)
{ {
if (Cursor != IntPtr.Zero) if (Cursor != IntPtr.Zero)
{ {

View File

@@ -206,11 +206,6 @@ namespace OpenRA.Platforms.Default
} }
public void Dispose() public void Dispose()
{
Dispose(true);
}
void Dispose(bool disposing)
{ {
if (disposed) if (disposed)
return; return;

View File

@@ -96,11 +96,6 @@ namespace OpenRA.Platforms.Default
} }
public void Dispose() public void Dispose()
{
Dispose(true);
}
void Dispose(bool disposing)
{ {
if (disposed) if (disposed)
return; return;