/// <summary> /// Releases all the resources used by the <see cref="PageList"/> object. /// </summary> public void Dispose() { if (!m_disposed) { try { if (!m_memoryPool.IsDisposed) { m_memoryPool.ReleasePages(m_listOfPages.Select(x => x.MemoryPoolIndex)); m_listOfPages = null; } } catch (Exception ex) { Log.Publish(MessageLevel.Critical, "Unhandled exception when returning resources to the memory pool", null, null, ex); } finally { GC.SuppressFinalize(this); m_disposed = true; // Prevent duplicate dispose. } } }