using System;

namespace QC.QSPR;

public class DisposableObject : IDisposable
{
	private bool alreadyDisposed;

	protected virtual void Dispose(bool isDisposing)
	{
		if (!alreadyDisposed)
		{
			alreadyDisposed = true;
		}
	}

	~DisposableObject()
	{
		Dispose(isDisposing: false);
	}

	public void Dispose()
	{
		Dispose(isDisposing: true);
		GC.SuppressFinalize(this);
	}
}
