From b2c0217a0d6ed2a80a8ff7f489ad6bc3ef07b290 Mon Sep 17 00:00:00 2001 From: "mcmullen%netscape.com" Date: Wed, 3 Feb 1999 03:13:53 +0000 Subject: [PATCH] Put NS_INIT_REFCNT in all constructors, it says. So I moved this call out of the Initialize() method, and into the constructor. And lo! the assert went away. Magic. git-svn-id: svn://10.0.0.236/trunk@19404 18797224-902f-48f8-a5cc-f745e15eee43 --- .../xpfe/appshell/src/nsCommandLineService.cpp | 16 ++++++---------- .../startup/src/nsCommandLineService.cpp | 16 ++++++---------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/mozilla/xpfe/appshell/src/nsCommandLineService.cpp b/mozilla/xpfe/appshell/src/nsCommandLineService.cpp index 2d7179b3b88..793038c0333 100644 --- a/mozilla/xpfe/appshell/src/nsCommandLineService.cpp +++ b/mozilla/xpfe/appshell/src/nsCommandLineService.cpp @@ -60,15 +60,19 @@ protected: nsCmdLineService::nsCmdLineService() + : mArgCount(0) { - mArgCount = 0; + NS_INIT_REFCNT(); } +/* + * Implement the nsISupports methods... + */ +NS_IMPL_ISUPPORTS(nsCmdLineService, kICommandLineServiceIID); NS_IMETHODIMP nsCmdLineService::Initialize(int argc, char ** argv) { - NS_INIT_REFCNT(); PRInt32 i=0; nsresult rv = nsnull; @@ -233,14 +237,6 @@ nsCmdLineService::PrintCmdArgs() } #endif -/* - * Implement the nsISupports methods... - */ -NS_IMPL_ISUPPORTS(nsCmdLineService, kICommandLineServiceIID); - - - - NS_EXPORT nsresult NS_NewCmdLineService(nsICmdLineService** aResult) { if (nsnull == aResult) { diff --git a/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp b/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp index 2d7179b3b88..793038c0333 100644 --- a/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp +++ b/mozilla/xpfe/components/startup/src/nsCommandLineService.cpp @@ -60,15 +60,19 @@ protected: nsCmdLineService::nsCmdLineService() + : mArgCount(0) { - mArgCount = 0; + NS_INIT_REFCNT(); } +/* + * Implement the nsISupports methods... + */ +NS_IMPL_ISUPPORTS(nsCmdLineService, kICommandLineServiceIID); NS_IMETHODIMP nsCmdLineService::Initialize(int argc, char ** argv) { - NS_INIT_REFCNT(); PRInt32 i=0; nsresult rv = nsnull; @@ -233,14 +237,6 @@ nsCmdLineService::PrintCmdArgs() } #endif -/* - * Implement the nsISupports methods... - */ -NS_IMPL_ISUPPORTS(nsCmdLineService, kICommandLineServiceIID); - - - - NS_EXPORT nsresult NS_NewCmdLineService(nsICmdLineService** aResult) { if (nsnull == aResult) {