public static void DisposeAndClearHandle(ref SafeCurlSlistHandle curlHandle) { if (curlHandle != null) { curlHandle.Dispose(); curlHandle = null; } }
internal static bool curl_slist_append(SafeCurlSlistHandle curl_slist, string headerValue) { bool gotRef = false; try { curl_slist.DangerousAddRef(ref gotRef); IntPtr newHandle = curl_slist_append(curl_slist.DangerousGetHandle(), headerValue); if (newHandle != IntPtr.Zero) { curl_slist.SetHandle(newHandle); return true; } return false; } finally { if (!gotRef) curl_slist.DangerousRelease(); } }
internal static bool curl_slist_append(SafeCurlSlistHandle curl_slist, string headerValue) { bool gotRef = false; try { curl_slist.DangerousAddRef(ref gotRef); IntPtr newHandle = curl_slist_append(curl_slist.DangerousGetHandle(), headerValue); if (newHandle != IntPtr.Zero) { curl_slist.SetHandle(newHandle); return(true); } return(false); } finally { if (!gotRef) { curl_slist.DangerousRelease(); } } }