Skip to content

Commit

Permalink
Work on IDisposable. Fixing DNET-189.
Browse files Browse the repository at this point in the history
  • Loading branch information
cincuranet committed Oct 11, 2008
1 parent 32f0861 commit 69f447c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
29 changes: 26 additions & 3 deletions NETProvider/source/FirebirdSql/Data/Common/ParameterBuffer.cs
Expand Up @@ -23,12 +23,13 @@

namespace FirebirdSql.Data.Common
{
internal abstract class ParameterBuffer
internal abstract class ParameterBuffer : IDisposable
{
#region · Fields ·

private MemoryStream stream;
private bool isLittleEndian;
private bool isLittleEndian;
private bool _disposed = false;

#endregion

Expand Down Expand Up @@ -125,5 +126,27 @@ protected void Write(byte[] buffer, int offset, int count)
}

#endregion
}

#region IDisposable

public void Dispose()
{
this.Dispose(true);
}

private void Dispose(bool disposing)
{
if (!this._disposed)
{
if (disposing)
{
this.stream.Dispose();
this.stream = null;
}
}
this._disposed = true;
}

#endregion
}
}
Expand Up @@ -215,9 +215,6 @@ private void Dispose(bool disposing)
this.connection = null;
this.revent = null;
}

// There are no unmanaged resources to release, but
// if we add them, they need to be released here.
}
this._disposed = true;
}
Expand Down

0 comments on commit 69f447c

Please sign in to comment.