Ejemplo n.º 1
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        /// <param name="disposing"><c>true</c> if managed resources should be disposed.</param>
        protected virtual void Dispose(bool disposing)
        {
            if (!disposed)
            {
                lock (this) {
                    // if (disposing) // managed member cleanup
                    // unmanaged cleanup
                    if (m_pMulti != IntPtr.Zero)
                    {
                        External.curl_multi_cleanup(m_pMulti);
                        m_pMulti = IntPtr.Zero;
                    }
                    if (m_fdSets != IntPtr.Zero)
                    {
                        External.curl_shim_free_fd_sets(m_fdSets);
                        m_fdSets = IntPtr.Zero;
                    }
                }

                disposed = true;
            }
        }