Add nsTraceRefcnt debugging hooks for a few MS-COM objects, some of which are leaking. r=rods sr=jag b=114171

This commit is contained in:
dbaron%fas.harvard.edu 2002-01-07 23:55:11 +00:00
Родитель 7cc0fdc6b3
Коммит 051d7cc944
3 изменённых файлов: 17 добавлений и 5 удалений

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

@ -129,8 +129,10 @@ STDMETHODIMP nsDataObj::QueryInterface(REFIID riid, void** ppv)
STDMETHODIMP_(ULONG) nsDataObj::AddRef()
{
++g_cRef;
++m_cRef;
NS_LOG_ADDREF(this, m_cRef, "nsDataObj", sizeof(*this));
//PRNTDEBUG3("nsDataObj::AddRef >>>>>>>>>>>>>>>>>> %d on %p\n", (m_cRef+1), this);
return ++m_cRef;
return m_cRef;
}
@ -141,6 +143,7 @@ STDMETHODIMP_(ULONG) nsDataObj::Release()
if (0 < g_cRef)
--g_cRef;
NS_LOG_RELEASE(this, m_cRef, "nsDataObj");
if (0 != --m_cRef)
return m_cRef;

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

@ -37,6 +37,7 @@
#include "nsNativeDragSource.h"
#include <stdio.h>
#include "nsISupportsImpl.h"
/*
@ -71,12 +72,16 @@ STDMETHODIMP nsNativeDragSource::QueryInterface(REFIID riid, void** ppv)
STDMETHODIMP_(ULONG) nsNativeDragSource::AddRef(void)
{
return ++m_cRef;
++m_cRef;
NS_LOG_ADDREF(this, m_cRef, "nsNativeDragSource", sizeof(*this));
return m_cRef;
}
STDMETHODIMP_(ULONG) nsNativeDragSource::Release(void)
{
if (0 != --m_cRef)
--m_cRef;
NS_LOG_RELEASE(this, m_cRef, "nsNativeDragSource");
if (0 != m_cRef)
return m_cRef;
delete this;

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

@ -117,13 +117,17 @@ STDMETHODIMP nsNativeDragTarget::QueryInterface(REFIID riid, void** ppv)
//-----------------------------------------------------
STDMETHODIMP_(ULONG) nsNativeDragTarget::AddRef(void)
{
return ++m_cRef;
++m_cRef;
NS_LOG_ADDREF(this, m_cRef, "nsNativeDragTarget", sizeof(*this));
return m_cRef;
}
//-----------------------------------------------------
STDMETHODIMP_(ULONG) nsNativeDragTarget::Release(void)
{
if (0 != --m_cRef)
--m_cRef;
NS_LOG_RELEASE(this, m_cRef, "nsNativeDragTarget");
if (0 != m_cRef)
return m_cRef;
delete this;