We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

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, cbiesinger
Last updated by: Waldo,