Closed
Bug 118893
Opened 24 years ago
Closed 24 years ago
Memory leak of 68 bytes from 1 block allocated in nsPrefService::nsPrefService
Categories
(Core :: Preferences: Backend, defect)
Tracking
()
VERIFIED
DUPLICATE
of bug 118894
People
(Reporter: stephend, Assigned: bnesse)
Details
(Keywords: memory-leak)
Build ID: Latest Win32 trunk on Windows 2000 running under Purify.
Summary: Memory leak of 68 bytes from 1 block allocated in
nsPrefService::nsPrefService
Steps to Reproduce:
1. Launch mozilla -compose (HTML compose).
2. Autocomplete an address, then arrow to it in the drop-down list.
3. Type 'test' in the subject and 'test' in the body.
4. Hit Send.
[W] MLK: Memory leak of 68 bytes from 1 block allocated in
nsPrefService::nsPrefService(void)
Distribution of leaked blocks
Allocation location
new(UINT) [MSVCRT.DLL]
nsPrefService::nsPrefService(void) [nsPrefService.cpp:94]
NS_INIT_REFCNT();
=> rootBranch = new nsPrefBranch("", PR_FALSE);
mRootBranch = (nsIPrefBranch *)rootBranch;
}
??? [ip=0x0013fc64]
nsPrefServiceConstructor [nsPrefsFactory.cpp:48]
extern NS_IMETHODIMP nsPrefConstructor(nsISupports *aOuter, REFNSIID aIID,
void **aResult);
=> NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrefService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrefLocalizedString, Init)
// The list of components we register
nsGenericFactory::CreateInstance(nsISupports *,nsID const&,void * *)
[nsGenericFactory.cpp:74]
REFNSIID aIID, void **aResult)
{
if (mInfo->mConstructor) {
=> return mInfo->mConstructor(aOuter, aIID, aResult);
}
return NS_ERROR_FACTORY_NOT_REGISTERED;
nsComponentManagerImpl::CreateInstanceByContractID(char const*,nsISupports
*,nsID const&,void * *) [nsComponentManager.cpp:1658]
nsresult res = FindFactory(aContractID, &factory);
if (NS_SUCCEEDED(res))
{
=> res = factory->CreateInstance(aDelegate, aIID, aResult);
NS_RELEASE(factory);
}
else
nsComponentManagerImpl::GetServiceByContractID(char const*,nsID const&,void
* *) [nsComponentManager.cpp:2023]
// the service manager:
mon.Exit();
=> rv = CreateInstanceByContractID(aContractID, NULL, aIID,
getter_AddRefs(service));
mon.Enter();
nsGetServiceByContractID::()(nsID const&,void * *)const
[nsComponentManager.cpp:242]
nsCOMPtr<nsIServiceManager> mgr;
NS_GetServiceManager(getter_AddRefs(mgr));
if (mgr)
=> status = mgr->GetServiceByContractID(mContractID, aIID,
(void**)aInstancePtr);
}
if ( NS_FAILED(status) )
nsCOMPtr_base::assign_from_helper(nsCOMPtr_helper const&,nsID const&)
[nsCOMPtr.cpp:80]
nsCOMPtr_base::assign_from_helper( const nsCOMPtr_helper& helper, const
nsIID& iid )
{
nsISupports* newRawPtr;
=> if ( NS_FAILED( helper(iid, NS_REINTERPRET_CAST(void**, &newRawPtr)) ) )
newRawPtr = 0;
assign_assuming_AddRef(newRawPtr);
}
nsMapiSupport::Observe(nsISupports *,char const*,WORD const*)
[msgMapiSupport.cpp:115]
rv = observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID,
PR_FALSE);
if (NS_FAILED(rv)) return rv;
=> nsCOMPtr<nsIPrefService> prefs =
do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIPrefBranchInternal> prefInternal = do_QueryInterface(prefs,
&rv);
nsAppStartupNotifier::Observe(nsISupports *,char const*,WORD const*)
[nsAppStartupNotifier.cpp:104]
startupObserver = do_CreateInstance(contractId, &rv);
if (NS_SUCCEEDED(rv)) {
=> rv = startupObserver->Observe(nsnull, aTopic, nsnull);
// mainly for debugging if you want to know if your
observer worked.
NS_ASSERTION(NS_SUCCEEDED(rv), "Startup Observer
failed!\n");
main1 [nsAppRunner.cpp:1138]
nsCOMPtr<nsIObserver> startupNotifier =
do_CreateInstance(NS_APPSTARTUPNOTIFIER_CONTRACTID, &rv);
if(NS_FAILED(rv))
return rv;
=> startupNotifier->Observe(nsnull, APPSTARTUP_TOPIC, nsnull);
NS_TIMELINE_LEAVE("startupNotifier");
NS_TIMELINE_ENTER("cmdLineArgs");
main [nsAppRunner.cpp:1594]
}
#endif
=> nsresult mainResult = main1(argc, argv, nativeApp ?
(nsISupports*)nativeApp : (nsISupports*)splash);
/* if main1() didn't succeed, then don't bother trying to shut down
clipboard, etc */
if (NS_SUCCEEDED(mainResult)) {
WinMain [nsAppRunner.cpp:1612]
// We need WinMain in order to not be a console app. This function is
// unused if we are a console application.
int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR args, int )
=> {
// Do the real work.
return main( __argc, __argv );
}
WinMainCRTStartup [crtexew.obj]
| Reporter | ||
Updated•24 years ago
|
Updated•24 years ago
|
QA Contact: sairuh → jrgm
| Assignee | ||
Comment 1•24 years ago
|
||
This is being "leaked" because the preferences service isn't being properly shut
down and this object is a member of the nsPrefService object. Fixing bug 118894
will fix this bug. marking as a dupe.
*** This bug has been marked as a duplicate of 118894 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•