From d7bce8632c56ebbb5e5b8ee03c5cc84a86c7299d Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Tue, 4 May 1999 20:34:31 +0000 Subject: [PATCH] part of mailnews audit --> use nsCOMPtr. --- mailnews/compose/src/nsSmtpUrl.cpp | 11 +---------- mailnews/compose/src/nsSmtpUrl.h | 3 ++- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/mailnews/compose/src/nsSmtpUrl.cpp b/mailnews/compose/src/nsSmtpUrl.cpp index f589b961ae7c..17db6892b150 100644 --- a/mailnews/compose/src/nsSmtpUrl.cpp +++ b/mailnews/compose/src/nsSmtpUrl.cpp @@ -78,21 +78,16 @@ nsSmtpUrl::nsSmtpUrl(nsISupports* aContainer, nsIURLGroup* aGroup) : m_search = nsnull; m_errorMessage = nsnull; m_runningUrl = PR_FALSE; - - nsServiceManager::GetService(kUrlListenerManagerCID, nsIUrlListenerManager::GetIID(), - (nsISupports **)&m_urlListeners); + nsComponentManager::CreateInstance(kUrlListenerManagerCID, nsnull, nsIUrlListenerManager::GetIID(), (void **) getter_AddRefs(m_urlListeners)); m_container = aContainer; NS_IF_ADDREF(m_container); - // ParseURL(aSpec, aURL); // XXX whh } nsSmtpUrl::~nsSmtpUrl() { CleanupSmtpState(); - NS_IF_RELEASE(m_urlListeners); - NS_IF_RELEASE(m_container); PR_FREEIF(m_errorMessage); @@ -105,10 +100,6 @@ nsSmtpUrl::~nsSmtpUrl() PR_FREEIF(m_file); PR_FREEIF(m_ref); PR_FREEIF(m_search); - if (nsnull != m_URL_s) - { -// NET_DropURLStruct(m_URL_s); - } } NS_IMPL_THREADSAFE_ADDREF(nsSmtpUrl); diff --git a/mailnews/compose/src/nsSmtpUrl.h b/mailnews/compose/src/nsSmtpUrl.h index 08a79f5a4630..499d15ed3791 100644 --- a/mailnews/compose/src/nsSmtpUrl.h +++ b/mailnews/compose/src/nsSmtpUrl.h @@ -20,6 +20,7 @@ #define nsSmtpUrl_h__ #include "nsISmtpUrl.h" +#include "nsCOMPtr.h" #include "nsINetlibURL.h" /* this should be temporary until Network N2 project lands */ #include "nsIUrlListenerManager.h" @@ -160,7 +161,7 @@ protected: nsISupports* m_container; // manager of all of current url listeners.... - nsIUrlListenerManager * m_urlListeners; + nsCOMPtr m_urlListeners; /* Smtp specific event sinks */ nsString m_userPassword;