public void Dispose() { if (!disposed) { FreeImageApi.Unload(m_Handle); if (m_MemPtr != IntPtr.Zero) { FreeImageApi.CloseMemory(m_MemPtr); } } disposed = true; //FreeImageApi.DeInitialize(); }