From 822d5724d334804374c57fec543f60989f64c9e6 Mon Sep 17 00:00:00 2001 From: "norris%netscape.com" Date: Tue, 12 Oct 1999 22:52:49 +0000 Subject: [PATCH] Work on 15824 bad refcounting in nsCodebasePrincipal Attempt to discover problem with additional assertions reviewed by mstoltz@netscape.com --- caps/src/nsCodebasePrincipal.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/caps/src/nsCodebasePrincipal.cpp b/caps/src/nsCodebasePrincipal.cpp index 2f47068a66b2..505f2d002458 100644 --- a/caps/src/nsCodebasePrincipal.cpp +++ b/caps/src/nsCodebasePrincipal.cpp @@ -34,6 +34,7 @@ NS_IMPL_QUERY_INTERFACE2(nsCodebasePrincipal, nsICodebasePrincipal, nsIPrincipal NS_IMETHODIMP_(nsrefcnt) nsCodebasePrincipal::AddRef(void) { + NS_PRECONDITION(PRInt32(mRefCnt) == 0, "illegal mRefCnt"); NS_PRECONDITION(PRInt32(mJSPrincipals.refcount) >= 0, "illegal refcnt"); ++mJSPrincipals.refcount; NS_LOG_ADDREF(this, mJSPrincipals.refcount, "nsCodebasePrincipal", sizeof(*this)); @@ -43,6 +44,7 @@ nsCodebasePrincipal::AddRef(void) NS_IMETHODIMP_(nsrefcnt) nsCodebasePrincipal::Release(void) { + NS_PRECONDITION(PRInt32(mRefCnt) == 0, "illegal mRefCnt"); NS_PRECONDITION(0 != mJSPrincipals.refcount, "dup release"); --mJSPrincipals.refcount; NS_LOG_RELEASE(this, mJSPrincipals.refcount, "nsCodebasePrincipal");