private void Dispose(bool disposing) { lock (this) { // if (disposing) // managed member cleanup // unmanaged cleanup if (_pMulti != IntPtr.Zero) { NativeMethods.curl_multi_cleanup(_pMulti); _pMulti = IntPtr.Zero; } #if USE_LIBCURLSHIM if (_fdSets != IntPtr.Zero) { NativeMethods.curl_shim_free_fd_sets(_fdSets); _fdSets = IntPtr.Zero; } #else _fd_read.Cleanup(); _fd_write.Cleanup(); _fd_except.Cleanup(); #endif } }