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.

This commit is contained in:
mcmullen%netscape.com 1999-02-03 03:13:53 +00:00
parent e2bbc594b2
commit 70f1ea2b11
2 changed files with 12 additions and 20 deletions

View File

@ -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) {

View File

@ -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) {