Closed
Bug 107585
Opened 23 years ago
Closed 23 years ago
nsPrefBranch calls getService on shutdown; should register shutdown listener
Categories
(Core :: Preferences: Backend, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: depman1, Assigned: bnesse)
References
Details
Attachments
(1 file)
901 bytes,
patch
|
dougt
:
review+
alecf
:
superreview+
|
Details | Diff | Splinter Review |
reproduced with 10/27 debug mozilla nightly build.
1. Set breakpoint in nsComponentManager.cpp: line 2075
2. Launch app in the debugger (F5).
3. Quit the app.
4. Check the stack trace.
5. Press F5 to advance debugger until you see ~nsPrefBranch in stack trace. Then
doubleclick on destructor line
Result: ~nsPrefBranch() calls do_GetService
Expected: Should register shutdown listener.
Here's the source of the destructor:
nsPrefBranch::~nsPrefBranch()
{
freeObserverList();
nsCOMPtr<nsIObserverService> observerService =
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
if (observerService)
observerService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
}
Reporter | ||
Comment 1•23 years ago
|
||
this results in warning msg when mozilla is shutdown (bug 107391)
Depends on: 107391
Comment 2•23 years ago
|
||
ironically it looks like we're just removing ourselves as a startup observer
the better choice would be to just make prefs add itself as a weak listener, and
then remove all this stuff at the end.
Comment 3•23 years ago
|
||
-> Preferences: Backend
Assignee: sgehani → bnesse
Component: Preferences → Preferences: Backend
Assignee | ||
Comment 4•23 years ago
|
||
Actually we already are added as a weak reference. All we have to do is not
remove ourselves.
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•23 years ago
|
||
Comment 6•23 years ago
|
||
Comment on attachment 55786 [details] [diff] [review]
Patch to not remove observer
looks good.
Attachment #55786 -
Flags: review+
Comment 7•23 years ago
|
||
Comment on attachment 55786 [details] [diff] [review]
Patch to not remove observer
sr=alecf
Attachment #55786 -
Flags: superreview+
Assignee | ||
Comment 8•23 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 9•23 years ago
|
||
verified with 11/2 nightly mozilla build. Removed the observer remover from
nsPrefBranch.cpp. nsPrefBranch destructor no longer appearing in the stack track
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•