mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Adding NS_RELEASE_THIS()
This commit is contained in:
parent
fc6f0e281e
commit
9fb13399c8
@ -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.
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user