MDN’s new design is in Beta! A sneak peek: https://blog.mozilla.org/opendesign/mdns-new-design-beta/

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

Summary

Macro

Addrefs the argument, if it is non-null. Does nothing for a null pointer. Only use this macro if the pointer might be NULL; use NS_ADDREF otherwise.

NS_IF_ADDREF(foo) is equal to

if (foo)
  foo->AddRef();

Syntax

NS_IF_ADDREF(foo);

See Also

NS_ADDREF

Document Tags and Contributors

 Contributors to this page: teoli, Nickolay, cbiesinger, Editmonkey
 Last updated by: Nickolay,