diff --git a/xpcom/build/nsXPComInit.cpp b/xpcom/build/nsXPComInit.cpp index 5b6373cd1a7..2c192d32504 100644 --- a/xpcom/build/nsXPComInit.cpp +++ b/xpcom/build/nsXPComInit.cpp @@ -206,7 +206,7 @@ nsresult NS_COM NS_InitXPCOM(nsIServiceManager* *result, nsComponentManagerImpl::gComponentManager = compMgr; } - rv = servMgr->RegisterService(kComponentManagerCID, compMgr); + rv = servMgr->RegisterService(kComponentManagerCID, NS_STATIC_CAST(nsIComponentManager*, compMgr)); if (NS_FAILED(rv)) return rv; // 3. Register the global services with the component manager so that diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index 57f1228f5c5..f0ebd073c1d 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -290,7 +290,7 @@ nsComponentManagerImpl::~nsComponentManagerImpl() } -NS_IMPL_ISUPPORTS(nsComponentManagerImpl, NS_GET_IID(nsIComponentManager)); +NS_IMPL_ISUPPORTS2(nsComponentManagerImpl, nsIComponentManager, nsISupportsWeakReference) //////////////////////////////////////////////////////////////////////////////// // nsComponentManagerImpl: Platform methods diff --git a/xpcom/components/nsComponentManager.h b/xpcom/components/nsComponentManager.h index aad4b814638..d965f1abd8b 100644 --- a/xpcom/components/nsComponentManager.h +++ b/xpcom/components/nsComponentManager.h @@ -28,6 +28,7 @@ #include "prtime.h" #include "prmon.h" #include "nsCOMPtr.h" +#include "nsWeakReference.h" class nsFactoryEntry; class nsDll; @@ -44,7 +45,7 @@ extern const char XPCOM_LIB_PREFIX[]; //////////////////////////////////////////////////////////////////////////////// -class nsComponentManagerImpl : public nsIComponentManager { +class nsComponentManagerImpl : public nsIComponentManager, public nsSupportsWeakReference { public: NS_DECL_ISUPPORTS NS_DECL_NSICOMPONENTMANAGER diff --git a/xpcom/components/nsNativeComponentLoader.cpp b/xpcom/components/nsNativeComponentLoader.cpp index 60bbbf9d9ed..9e62ad1fe0d 100644 --- a/xpcom/components/nsNativeComponentLoader.cpp +++ b/xpcom/components/nsNativeComponentLoader.cpp @@ -365,7 +365,7 @@ nsFreeLibrary(nsDll *dll, nsIServiceManager *serviceMgr, PRInt32 when) // Get the module object nsCOMPtr mobj; /* XXXshaver cheat and use the global component manager */ - rv = dll->GetModule(nsComponentManagerImpl::gComponentManager, + rv = dll->GetModule(NS_STATIC_CAST(nsIComponentManager*, nsComponentManagerImpl::gComponentManager), getter_AddRefs(mobj)); if (NS_SUCCEEDED(rv)) {