From 900b8a584249e754f3ae1a0cfb9bde8fdc3a4b35 Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Tue, 4 May 1999 22:48:37 +0000 Subject: [PATCH] part of mailnews audit --> Conversion to NS_WITH_SERVICE --- mailnews/local/tests/pop3/pop3Test.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/mailnews/local/tests/pop3/pop3Test.cpp b/mailnews/local/tests/pop3/pop3Test.cpp index b44aa3a4bb2..922b549d79f 100644 --- a/mailnews/local/tests/pop3/pop3Test.cpp +++ b/mailnews/local/tests/pop3/pop3Test.cpp @@ -318,10 +318,8 @@ static NS_DEFINE_CID(kCMsgMailSessionCID, NS_MSGMAILSESSION_CID); nsresult nsPop3TestDriver::OnIdentityCheck() { - nsIMsgMailSession * mailSession = nsnull; - nsresult result = nsServiceManager::GetService(kCMsgMailSessionCID, - nsIMsgMailSession::GetIID(), - (nsISupports **) &mailSession); + nsresult result = NS_OK; + NS_WITH_SERVICE(nsIMsgMailSession, mailSession, kCMsgMailSessionCID, &result); if (NS_SUCCEEDED(result) && mailSession) { // mscott: we really don't check an identity, we check @@ -344,8 +342,6 @@ nsresult nsPop3TestDriver::OnIdentityCheck() } else printf("Unable to retrieve the outgoing server interface....\n"); - - nsServiceManager::ReleaseService(kCMsgMailSessionCID, mailSession); } else printf("Unable to retrieve the mail session service....\n"); @@ -486,10 +482,8 @@ int main() } // Create the Event Queue for this thread... - nsIEventQueueService* pEventQService; - result = nsServiceManager::GetService(kEventQueueServiceCID, - nsIEventQueueService::GetIID(), - (nsISupports**)&pEventQService); + NS_WITH_SERVICE(nsIEventQueueService, pEventQService, kEventQueueServiceCID, &result); + if (NS_FAILED(result)) return result; result = pEventQService->CreateThreadEventQueue();