using System;

namespace Quadarax.Foundation.Common.Object
{
    public abstract class DisposableObject : IDisposable
    {
        private bool _isDisposing;

        public void Dispose()
        {
            if (_isDisposing)
                return;
            _isDisposing = true;
            OnDisposing();
        }

        protected abstract void OnDisposing();
    }
}
