Adding NS_RELEASE_THIS()

This commit is contained in:
dveditz%netscape.com 1999-06-16 03:28:25 +00:00
parent fc6f0e281e
commit 9fb13399c8
2 changed files with 36 additions and 0 deletions

View File

@ -607,6 +607,24 @@ NS_IMETHODIMP _class::QueryInterface(REFNSIID aIID, void** aInstancePtr) \
PR_END_MACRO
#endif
/**
* Macro for releasing a reference to an interface.
*
* Note that when MOZ_TRACE_XPCOM_REFCNT is defined that the release will
* be done before the trace message is logged. If the reference count
* goes to zero and implementation of Release logs a message, the two
* messages will be logged out of order.
*
* @param _ptr The interface pointer.
*/
#ifdef MOZ_TRACE_XPCOM_REFCNT
#define NS_RELEASE_THIS() \
nsTraceRefcnt::Release(this, Release(), __FILE__, __LINE__)
#else
#define NS_RELEASE_THIS() \
Release()
#endif
/**
* Macro for releasing a reference to an interface, except that this
* macro preserves the return value from the underlying Release call.

View File

@ -607,6 +607,24 @@ NS_IMETHODIMP _class::QueryInterface(REFNSIID aIID, void** aInstancePtr) \
PR_END_MACRO
#endif
/**
* Macro for releasing a reference to an interface.
*
* Note that when MOZ_TRACE_XPCOM_REFCNT is defined that the release will
* be done before the trace message is logged. If the reference count
* goes to zero and implementation of Release logs a message, the two
* messages will be logged out of order.
*
* @param _ptr The interface pointer.
*/
#ifdef MOZ_TRACE_XPCOM_REFCNT
#define NS_RELEASE_THIS() \
nsTraceRefcnt::Release(this, Release(), __FILE__, __LINE__)
#else
#define NS_RELEASE_THIS() \
Release()
#endif
/**
* Macro for releasing a reference to an interface, except that this
* macro preserves the return value from the underlying Release call.