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

git-svn-id: svn://10.0.0.236/trunk@111513 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%fas.harvard.edu
2002-01-07 23:55:11 +00:00
parent e62ed2cbd9
commit 5d585186dd
3 changed files with 17 additions and 5 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;