protected virtual void Dispose(bool disposing)
{
// Check to see if Dispose has already been called.
if (!this.disposed) {
// If disposing equals true, dispose all managed
// and unmanaged resources.
if (disposing) {
// Dispose managed resources.
if (this.bmpTargaImage != null) {
this.bmpTargaImage.Dispose();
}
if (this.bmpImageThumbnail != null) {
this.bmpImageThumbnail.Dispose();
}
if (this.ImageByteHandle != null) {
if (this.ImageByteHandle.IsAllocated) {
this.ImageByteHandle.Free();
}
}
if (this.ThumbnailByteHandle != null) {
if (this.ThumbnailByteHandle.IsAllocated) {
this.ThumbnailByteHandle.Free();
}
}
}
// Release unmanaged resources. If disposing is false,
// only the following code is executed.
// ** release unmanged resources here **
// Note that this is not thread safe.
// Another thread could start disposing the object
// after the managed resources are disposed,
// but before the disposed flag is set to true.
// If thread safety is necessary, it must be
// implemented by the client.
}
disposed = true;
}