OpenHome.Net.Core.NetworkAdapter.RemoveRef C# (CSharp) Method

RemoveRef() public method

Remove a reference to the network adapter.
Removing the final reference causes the network adapter to be deleted.
public RemoveRef ( string aCookie ) : void
aCookie string
return void
        public void RemoveRef(string aCookie)
        {
            CookieWrapper cookie = null;
            lock (this)
            {
                for (int i = 0; i < iCookies.Count; i++)
                {
                    if (iCookies[i].AsString == aCookie)
                    {
                        cookie = iCookies[i];
                        iCookies.RemoveAt(i);
                        break;
                    }
                }
            }
            if (cookie == null)
                throw new ArgumentException();
            OhNetNetworkAdapterRemoveRef(iHandle, cookie.AsCString);
            cookie.Dispose();
        }
    }