зеркало из https://github.com/mozilla/pjs.git
Added constructor/destructor counting macros for various mailnews
classes. reviewed by bienvenu. no bug.
This commit is contained in:
Родитель
588aa7f0f3
Коммит
90dd3b01dd
|
@ -38,6 +38,7 @@
|
|||
static NS_DEFINE_CID(kMsgIdentityCID, NS_MSGIDENTITY_CID);
|
||||
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
|
||||
|
||||
|
||||
class nsMsgAccount : public nsIMsgAccount,
|
||||
public nsIShutdownListener
|
||||
{
|
||||
|
@ -94,17 +95,23 @@ nsMsgAccount::QueryInterface(const nsIID& iid, void **result)
|
|||
return rv;
|
||||
}
|
||||
|
||||
MOZ_DECL_CTOR_COUNTER(nsMsgAccount);
|
||||
|
||||
nsMsgAccount::nsMsgAccount():
|
||||
m_accountKey(0),
|
||||
m_prefs(0),
|
||||
m_incomingServer(null_nsCOMPtr()),
|
||||
m_defaultIdentity(null_nsCOMPtr())
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsMsgAccount);
|
||||
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
nsMsgAccount::~nsMsgAccount()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsMsgAccount);
|
||||
|
||||
// release of servers an identites happen automatically
|
||||
// thanks to nsCOMPtrs and nsISupportsArray
|
||||
|
||||
|
|
|
@ -144,9 +144,13 @@ nsrefcnt nsMsgAccountManagerDataSource::gAccountManagerResourceRefCnt = 0;
|
|||
#define NC_RDF_IDENTITY NC_NAMESPACE_URI "Identity"
|
||||
#define NC_RDF_SETTINGS NC_NAMESPACE_URI "Settings"
|
||||
|
||||
MOZ_DECL_CTOR_COUNTER(nsMsgAccountManagerDataSource);
|
||||
|
||||
nsMsgAccountManagerDataSource::nsMsgAccountManagerDataSource():
|
||||
mAccountManager(null_nsCOMPtr())
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsMsgAccountManagerDataSource);
|
||||
|
||||
#ifdef DEBUG_amds
|
||||
printf("nsMsgAccountManagerDataSource() being created\n");
|
||||
#endif
|
||||
|
@ -164,6 +168,7 @@ nsMsgAccountManagerDataSource::nsMsgAccountManagerDataSource():
|
|||
|
||||
nsMsgAccountManagerDataSource::~nsMsgAccountManagerDataSource()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsMsgAccountManagerDataSource);
|
||||
if (--gAccountManagerResourceRefCnt == 0)
|
||||
{
|
||||
NS_IF_RELEASE(kNC_Child);
|
||||
|
|
|
@ -42,6 +42,8 @@
|
|||
|
||||
#include "nsMessageViewDataSource.h"
|
||||
|
||||
#include "nsTraceRefcnt.h"
|
||||
|
||||
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
|
||||
static NS_DEFINE_CID(kMsgMailSessionCID, NS_MSGMAILSESSION_CID);
|
||||
static NS_DEFINE_CID(kMsgCopyServiceCID, NS_MSGCOPYSERVICE_CID);
|
||||
|
@ -72,10 +74,12 @@ nsIRDFResource* nsMsgFolderDataSource::kNC_EmptyTrash= nsnull;
|
|||
|
||||
nsrefcnt nsMsgFolderDataSource::gFolderResourceRefCnt = 0;
|
||||
|
||||
MOZ_DECL_CTOR_COUNTER(nsMsgFolderDataSource);
|
||||
|
||||
nsMsgFolderDataSource::nsMsgFolderDataSource():
|
||||
mInitialized(PR_FALSE)
|
||||
{
|
||||
|
||||
MOZ_COUNT_CTOR(nsMsgFolderDataSource);
|
||||
}
|
||||
|
||||
nsMsgFolderDataSource::~nsMsgFolderDataSource (void)
|
||||
|
@ -114,7 +118,7 @@ nsMsgFolderDataSource::~nsMsgFolderDataSource (void)
|
|||
NS_RELEASE2(kNC_Rename, refcnt);
|
||||
NS_RELEASE2(kNC_EmptyTrash, refcnt);
|
||||
}
|
||||
|
||||
MOZ_COUNT_DTOR(nsMsgFolderDataSource);
|
||||
}
|
||||
|
||||
nsresult nsMsgFolderDataSource::Init()
|
||||
|
|
|
@ -40,18 +40,23 @@ static NS_DEFINE_CID(kFileLocatorCID, NS_FILELOCATOR_CID);
|
|||
//static NS_DEFINE_CID(kPop3IncomingServerCID, NS_POP3INCOMINGSERVER_CID);
|
||||
//static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
|
||||
|
||||
MOZ_DECL_CTOR_COUNTER(nsMsgMailSession);
|
||||
|
||||
nsMsgMailSession::nsMsgMailSession():
|
||||
mRefCnt(0),
|
||||
m_accountManager(0),
|
||||
m_msgFolderCache(0)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsMsgMailSession);
|
||||
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
|
||||
nsMsgMailSession::~nsMsgMailSession()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsMsgMailSession);
|
||||
|
||||
if(m_accountManager)
|
||||
{
|
||||
// if (m_msgFolderCache)
|
||||
|
|
|
@ -68,17 +68,19 @@ nsIRDFResource* nsMsgMessageDataSource::kNC_MarkUnflagged= nsnull;
|
|||
|
||||
nsrefcnt nsMsgMessageDataSource::gMessageResourceRefCnt = 0;
|
||||
|
||||
MOZ_DECL_CTOR_COUNTER(nsMsgMessageDataSource);
|
||||
|
||||
nsMsgMessageDataSource::nsMsgMessageDataSource():
|
||||
mInitialized(PR_FALSE),
|
||||
mHeaderParser(nsnull)
|
||||
{
|
||||
|
||||
MOZ_COUNT_CTOR(nsMsgMessageDataSource);
|
||||
|
||||
}
|
||||
|
||||
nsMsgMessageDataSource::~nsMsgMessageDataSource (void)
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsMsgMessageDataSource);
|
||||
nsresult rv;
|
||||
|
||||
if (!m_shuttingDown)
|
||||
|
|
|
@ -20,15 +20,18 @@
|
|||
#include "nsMessage.h"
|
||||
#include "nsIMsgFolder.h"
|
||||
|
||||
MOZ_DECL_CTOR_COUNTER(nsMessage);
|
||||
|
||||
nsMessage::nsMessage(void)
|
||||
: nsRDFResource(), mFolder(nsnull)
|
||||
{
|
||||
|
||||
|
||||
MOZ_COUNT_CTOR(nsMessage);
|
||||
}
|
||||
|
||||
nsMessage::~nsMessage(void)
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsMessage);
|
||||
//Member variables are either nsCOMPtr's or ptrs we don't want to own.
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
|
|||
static NS_DEFINE_CID(kMsgMailSessionCID, NS_MSGMAILSESSION_CID);
|
||||
|
||||
|
||||
MOZ_DECL_CTOR_COUNTER(nsMsgFolder);
|
||||
|
||||
nsMsgFolder::nsMsgFolder(void)
|
||||
: nsRDFResource(),
|
||||
|
@ -54,7 +55,7 @@ nsMsgFolder::nsMsgFolder(void)
|
|||
mIsServer(PR_FALSE)
|
||||
{
|
||||
// NS_INIT_REFCNT(); done by superclass
|
||||
|
||||
MOZ_COUNT_CTOR(nsMsgFolder);
|
||||
|
||||
mSemaphoreHolder = NULL;
|
||||
|
||||
|
@ -74,6 +75,7 @@ nsMsgFolder::nsMsgFolder(void)
|
|||
|
||||
nsMsgFolder::~nsMsgFolder(void)
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsMsgFolder);
|
||||
if(mSubFolders)
|
||||
{
|
||||
PRUint32 count;
|
||||
|
|
|
@ -40,17 +40,24 @@ static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
|
|||
static NS_DEFINE_CID(kNetSupportDialogCID, NS_NETSUPPORTDIALOG_CID);
|
||||
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
|
||||
|
||||
MOZ_DECL_CTOR_COUNTER(nsMsgIncomingServer);
|
||||
|
||||
nsMsgIncomingServer::nsMsgIncomingServer():
|
||||
m_prefs(0),
|
||||
m_serverKey(0),
|
||||
m_rootFolder(0)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsMsgIncomingServer);
|
||||
|
||||
NS_INIT_REFCNT();
|
||||
m_serverBusy = PR_FALSE;
|
||||
}
|
||||
|
||||
nsMsgIncomingServer::~nsMsgIncomingServer()
|
||||
{
|
||||
|
||||
MOZ_COUNT_DTOR(nsMsgIncomingServer);
|
||||
|
||||
if (m_prefs) nsServiceManager::ReleaseService(kPrefServiceCID,
|
||||
m_prefs,
|
||||
nsnull);
|
||||
|
|
Загрузка…
Ссылка в новой задаче