} else if ( aClass.Equals(kProfileCoreCID) ) { inst = new nsProfileCoreFactory();
NSGetFactory(nsISupports* serviceMgr,             const nsCID &aClass,             const char *aClassName,             const char *aProgID,             nsIFactory **aFactory){    if (aFactory == NULL)    {        return NS_ERROR_NULL_POINTER;    }    *aFactory = NULL;    nsISupports *inst;    if ( aClass.Equals(kAppCoresManagerCID) )    {        inst = new nsAppCoresManagerFactory();            }    else if ( aClass.Equals(kProfileCoreCID) )     {         inst = new nsProfileCoreFactory();     }    else if ( aClass.Equals(kToolkitCoreCID) )    {        inst = new nsToolkitCoreFactory();    }    else    {        return NS_ERROR_ILLEGAL_VALUE;    }    if (inst == NULL)    {           return NS_ERROR_OUT_OF_MEMORY;    }    nsresult res = inst->QueryInterface(kIFactoryIID, (void**) aFactory);    if (res != NS_OK)    {           delete inst;    }  return res;}