Mozilla.com

  1. MDC
  2. Main Page
  3. NS_IF_RELEASE
Table of contents
  1. 1. Summary
  2. 2. Syntax
  3. 3. See Also

NS_IF_RELEASE

Table of contents
  1. 1. Summary
  2. 2. Syntax
  3. 3. See Also

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

Page last modified 07:41, 12 May 2008 by Waldo

Files (0)