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

NS_ADDREF

Summary

Macro

Addrefs the argument. Do not use when the pointer might be null; use NS_IF_ADDREF in those cases.

NS_ADDREF(foo) is equivalent to

foo->AddRef();

This macro exists mainly for historical reasons, but for consistency and for symmetry with NS_RELEASE it should still be used.

Syntax

NS_ADDREF(foo);

See Also

NS_IF_ADDREF NS_RELEASE

Document Tags and Contributors

 Contributors to this page: teoli, Nickolay, Biesi
 Last updated by: Nickolay,