Changed NS_RELEASE2(...) macro to conditionally NULL the interface argument...

This commit is contained in:
rpotts%netscape.com 1998-09-17 05:38:21 +00:00
Родитель 64fbddffe3
Коммит dac2d400b3
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -240,6 +240,8 @@ nsrefcnt _class::AddRef(void) \
/**
* Macro for releasing a reference to an interface, except that this
* macro preserves the return value from the underlying Release call.
* The interface pointer argument will only be NULLed if the reference count
* goes to zero.
*
* 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
@ -252,11 +254,12 @@ nsrefcnt _class::AddRef(void) \
#define NS_RELEASE2(_ptr, _result) \
_result = ((nsrefcnt) nsTraceRefcnt::Release((_ptr), (_ptr)->Release(), \
__FILE__, __LINE__)); \
(_ptr) = NULL
if (0 == (_result)) (_ptr) = NULL
#else
#define NS_RELEASE2(_ptr, _result) \
_result = (_ptr)->Release(); \
(_ptr) = NULL
if (0 == (_result)) (_ptr) = NULL
#endif
/**