Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

NS_IF_RELEASE

This page still needs some work, help to improve it!

Summary

Macro

Decrements the reference count of a pointer by one. This macro also sets the pointer to NULL. NS_IF_RELEASE has no effect when the pointer is NULL. This macro should only be used when the pointer might be NULL; otherwise, use NS_RELEASE.

NS_IF_RELEASE is exactly equivalent to the following function:

inline void NS_IF_RELEASE(nsISupports* foo)
{
  if (foo)
    foo->Release();
  foo = 0;
}

Syntax

NS_IF_RELEASE(foo);

See Also

NS_ADDREF, NS_RELEASE

Document Tags and Contributors

 Contributors to this page: teoli, Waldo, Ehsan, Editmonkey, Biesi
 Last updated by: Waldo,