From 89b394422e5778d79e335903897a10f1429281a1 Mon Sep 17 00:00:00 2001 From: "warren%netscape.com" Date: Sun, 26 Sep 1999 10:04:36 +0000 Subject: [PATCH] Cleanup --- xpcom/ds/bufferRoutines.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/xpcom/ds/bufferRoutines.h b/xpcom/ds/bufferRoutines.h index c61b7b0de722..a2e9653c3637 100644 --- a/xpcom/ds/bufferRoutines.h +++ b/xpcom/ds/bufferRoutines.h @@ -514,14 +514,15 @@ static nsICaseConversion * gCaseConv = 0; NS_IMPL_ISUPPORTS(HandleCaseConversionShutdown3, kIShutdownListenerIID); nsresult HandleCaseConversionShutdown3::OnShutdown(const nsCID& cid, nsISupports* service) { + nsresult rv = NS_OK; if (cid.Equals(kUnicharUtilCID)) { NS_ASSERTION(service == gCaseConv, "wrong service!"); - if(gCaseConv){ - gCaseConv->Release(); - gCaseConv = 0; + if (gCaseConv) { + rv = nsServiceManager::ReleaseService(kUnicharUtilCID, gCaseConv); + gCaseConv = nsnull; } } - return NS_OK; + return rv; } @@ -531,7 +532,9 @@ public: mListener = new HandleCaseConversionShutdown3(); if(mListener){ mListener->AddRef(); - nsServiceManager::GetService(kUnicharUtilCID, kICaseConversionIID,(nsISupports**) &gCaseConv, mListener); + nsresult rv = nsServiceManager::GetService(kUnicharUtilCID, kICaseConversionIID, + (nsISupports**) &gCaseConv, mListener); + NS_ASSERTION(NS_SUCCEEDED(rv), "can't get case conversion service"); } } protected: