Closed
Bug 108046
Opened 23 years ago
Closed 23 years ago
DNSService Shutdown uses getService; suggest registering WeakRef
Categories
(Core :: Networking, defect, P1)
Tracking
()
VERIFIED
FIXED
mozilla0.9.9
People
(Reporter: depman1, Assigned: gordon)
References
Details
(Whiteboard: patch)
Attachments
(1 file)
1.95 KB,
patch
|
dougt
:
review+
gordon
:
superreview+
|
Details | Diff | Splinter Review |
reproduced in 10/27 debug mozilla build. this is causing a warning message when shutting down mozilla. see bug 107391. 1. Set break points in nsWarning messages in nsComponentManager.cpp; nsComponentManagerImpl::GetService() and nsComponentManagerImpl::GetServiceByContractID() (currently lines 1750 & 2075). 2. Launch Mozilla with F5. 3. Quit Mozilla. 4. F5 until you see stack trace including destructor for nsIOService() 5. Doubleclick on 3 lines above ~nsIOService(): nsDNSService::RemovePrefObserver() line 1178 + 30 bytes Result: Creates nsIPrefService object by calling do_GetService() to shutdown DNSService service. Suggest registering a weakReference and using it to shutdown service.
Reporter | ||
Comment 1•23 years ago
|
||
Here's the source in nsDnsService.cpp for RemovePrefObserver(): nsresult nsDNSService::RemovePrefObserver() { nsresult rv, rv2; nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv); if (NS_FAILED(rv)) return rv; nsCOMPtr<nsIPrefBranchInternal> prefInternal = do_QueryInterface(prefs, &rv); if (NS_FAILED(rv)) return rv; rv = prefInternal->RemoveObserver(NETWORK_ENABLEIDN, this); if (NS_FAILED(rv)) return rv; rv = prefInternal->RemoveObserver(NETWORK_DNS_CACHE_ENTRIES, this); rv2 = prefInternal->RemoveObserver(NETWORK_DNS_CACHE_EXPIRATION, this); return NS_FAILED(rv) ? rv : rv2; }
Targeting for necko stability milestone 0.9.8.
Target Milestone: --- → mozilla0.9.8
Doug, according to dp's comment (#6) in bug 107391, this is correct pattern to be using. Can we just close this bug?
Comment 5•23 years ago
|
||
The only problem is if we do not correct this pattern, we will have to wade through many false positives.
Comment 8•23 years ago
|
||
Comment on attachment 69538 [details] [diff] [review] proposed patch adding weak reference to pref service. r=dougt
Attachment #69538 -
Flags: review+
Comment on attachment 69538 [details] [diff] [review] proposed patch adding weak reference to pref service. sr=darin
Attachment #69538 -
Flags: superreview+
Assignee | ||
Comment 10•23 years ago
|
||
Patch checked in. Marking FIXED.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 11•22 years ago
|
||
David: Can you try your steps again and verify if it is gone?
Keywords: verifyme
Reporter | ||
Comment 12•22 years ago
|
||
Verified patch wrt to Mozilla 0.9.9 3/19/02 debug build. Looks fine. With steps above, nsDNSService::RemovePrefObserver()isn't in the shutdown call stack; getService() not used for dns service shutdown.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•