From 7709dc95aff26b3e89908c4aecfeea20f6953b6a Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Fri, 10 May 2002 20:48:45 +0000 Subject: [PATCH] initalizes member variables in thread poll. 141479. r=dp, sr=darin git-svn-id: svn://10.0.0.236/trunk@121277 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/threads/nsThread.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/mozilla/xpcom/threads/nsThread.cpp b/mozilla/xpcom/threads/nsThread.cpp index fea35271abb..ebd94a47dc0 100644 --- a/mozilla/xpcom/threads/nsThread.cpp +++ b/mozilla/xpcom/threads/nsThread.cpp @@ -477,7 +477,8 @@ inline nsThreadPoolBusyBody::~nsThreadPoolBusyBody() { nsThreadPool::nsThreadPool() : mMinThreads(0), mMaxThreads(0), mBusyThreads(0), - mShuttingDown(PR_FALSE) + mShuttingDown(PR_FALSE), mLock(nsnull), mThreadExit(nsnull), + mPendingRequestAdded(nsnull), mPendingRequestsAtZero(nsnull) { NS_INIT_REFCNT(); } @@ -797,15 +798,22 @@ nsThreadPool::Init(PRUint32 minThreadCount, return NS_OK; cleanup: - if (mLock) + if (mLock) { PR_DestroyLock(mLock); - if (mThreadExit) + mLock = nsnull; + } + if (mThreadExit) { PR_DestroyCondVar(mThreadExit); - if (mPendingRequestAdded) + mThreadExit = nsnull; + } + if (mPendingRequestAdded) { PR_DestroyCondVar(mPendingRequestAdded); - if (mPendingRequestsAtZero) + mPendingRequestAdded = nsnull; + } + if (mPendingRequestsAtZero) { PR_DestroyCondVar(mPendingRequestsAtZero); - + mPendingRequestsAtZero = nsnull; + } return NS_ERROR_OUT_OF_MEMORY; }