nsServiceManager::ReleaseService has been obsolete for ages. Callers should be replaced with NS_IF_RELEASE.
Created attachment 165039 [details] [diff] [review] v1 patch remove (nearly) all uses of nsServiceManager:: methods.
Assignee: dbaron → darin
Status: NEW → ASSIGNED
the plugin code still uses nsServiceManager::GetGlobalServiceManager for use with deprecated xpcom-style plugins.
Summary: remove callers of nsServiceManager::ReleaseService → remove callers of nsServiceManager:: methods
Status: ASSIGNED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
if lxr is to be trusted, this missed a file: /xpfe/components/search/src/nsLocalSearchService.cpp, line 99 -- nsresult rv = nsServiceManager::GetService(kRDFServiceCID, /xpfe/components/search/src/nsLocalSearchService.cpp, line 140 -- nsServiceManager::ReleaseService(kRDFServiceCID, gRDFService); and possibly: /xpcom/tests/TestServMgr.cpp, line 102 -- err = nsServiceManager::UnregisterService(kIMyServiceCID);
Thanks biesi, The nsLocalSearchService.cpp one was real... I must have skipped over that one somehow. I went ahead and fixed it on the trunk. > /xpcom/tests/TestServMgr.cpp, line 102 -- err = > nsServiceManager::UnregisterService(kIMyServiceCID); This one is actually commented out.
part of this patch was backed-out as a result of the aviary branch landing
The only changes needed were to nsBookmarksService.cpp, and I went ahead and landed those.
This sorta caused bug 336586, through no fault of its own. Before this checkin, the code was just calling a method on a member of a deleted object, and the member was a pointer to a service that had been released. But the service was still kept alive by the service manager, so it sorta kinda worked. After this checkin, the member got nulled out in the destructor, leading to a crash when dereferenced....
Depends on: 336586
You need to log in before you can comment on or make changes to this bug.