backing out my fix to 166147 to see if it fixes orange

This commit is contained in:
alecf%netscape.com 2002-09-16 23:48:12 +00:00
parent b6bb993d1b
commit 7c03517f4d
5 changed files with 8 additions and 27 deletions

View File

@ -610,7 +610,7 @@ NS_IMPL_ADDREF(nsXULAttributes);
nsrefcnt
nsXULAttributes::Release()
{
--mRefCnt;
mRefCnt--;
NS_LOG_RELEASE(this, mRefCnt, "nsXULAttributes");
if (mRefCnt == 0) {
mRefCnt = 1; // stabilize (necessary for this class?)

View File

@ -208,10 +208,10 @@ public:
nsIURI* aDocumentURI,
nsISupportsArray* aNodeInfos) = 0;
void AddRef() { ++mRefCnt; };
void AddRef() { mRefCnt++; };
void Release()
{
--mRefCnt;
mRefCnt--;
if (mRefCnt == 0)
delete this;
};

View File

@ -432,7 +432,7 @@ nsrefcnt nsViewManager::Release(void)
delete this;
return 0;
}
--mRefCnt;
mRefCnt--;
return mRefCnt;
}

View File

@ -85,26 +85,7 @@ extern "C" NS_COM void NS_CheckThreadSafe(void* owningThread,
#endif // !(defined(NS_DEBUG) && defined(NS_MT_SUPPORTED))
class nsAutoRefCnt {
public:
nsAutoRefCnt() : mValue(0) {}
nsAutoRefCnt(nsrefcnt aValue) : mValue(aValue) {}
// only support prefix increment/decrement
nsrefcnt operator++() { return ++mValue; }
nsrefcnt operator--() { return --mValue; }
nsrefcnt operator=(nsrefcnt aValue) { return (mValue = aValue); }
operator nsrefcnt() const { return mValue; }
private:
// do not define these to enforce the faster prefix notation
nsrefcnt operator++(int);
nsrefcnt operator--(int);
nsrefcnt mValue;
};
///////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/**
* Declare the reference count variable and the implementations of the
@ -118,7 +99,7 @@ public: \
NS_IMETHOD_(nsrefcnt) AddRef(void); \
NS_IMETHOD_(nsrefcnt) Release(void); \
protected: \
nsAutoRefCnt mRefCnt; \
nsrefcnt mRefCnt; \
NS_DECL_OWNINGTHREAD \
public:
@ -129,7 +110,7 @@ public:
* Initialize the reference count variable. Add this to each and every
* constructor you implement.
*/
#define NS_INIT_ISUPPORTS() (NS_IMPL_OWNINGTHREAD())
#define NS_INIT_ISUPPORTS() (mRefCnt = 0, NS_IMPL_OWNINGTHREAD())
/**
* Use this macro to implement the AddRef method for a given <i>_class</i>

View File

@ -145,7 +145,7 @@ nsNativeAppSupportBase::CreateSplashScreen( nsISplashScreen **splash ) {
// Standard implementations of AddRef/Release/QueryInterface.
NS_IMETHODIMP_(nsrefcnt)
nsNativeAppSupportBase::AddRef() {
++mRefCnt;
mRefCnt++;
return mRefCnt;
}