From aa1ba6ea799b9c33fc4837d4eb3a8d341a10ddb0 Mon Sep 17 00:00:00 2001 From: "sfraser%netscape.com" Date: Sat, 19 Jun 1999 22:07:13 +0000 Subject: [PATCH] Explode addref & release macros to make debugging easier. --- xpfe/appshell/src/nsWebShellWindow.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/xpfe/appshell/src/nsWebShellWindow.cpp b/xpfe/appshell/src/nsWebShellWindow.cpp index 42d41d4a331..ac06ab5aefb 100644 --- a/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/xpfe/appshell/src/nsWebShellWindow.cpp @@ -225,9 +225,23 @@ nsWebShellWindow::~nsWebShellWindow() } +NS_IMETHODIMP_(nsrefcnt) nsWebShellWindow::AddRef(void) +{ + NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt"); + ++mRefCnt; + return mRefCnt; +} -NS_IMPL_ADDREF(nsWebShellWindow); -NS_IMPL_RELEASE(nsWebShellWindow); +NS_IMETHODIMP_(nsrefcnt) nsWebShellWindow::Release(void) +{ + NS_PRECONDITION(0 != mRefCnt, "dup release"); + --mRefCnt; + if (mRefCnt == 0) { + NS_DELETEXPCOM(this); + return 0; + } + return mRefCnt; +} nsresult nsWebShellWindow::QueryInterface(REFNSIID aIID, void** aInstancePtr)