Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

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,