Don't entrain observer service in update service

RESOLVED FIXED in mozilla1.8.1alpha2

Status

()

RESOLVED FIXED
13 years ago
10 years ago

People

(Reporter: benjamin, Assigned: benjamin)

Tracking

({fixed1.8.1})

unspecified
mozilla1.8.1alpha2
fixed1.8.1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

13 years ago
I found some old code hanging around in a tree, and figured out why I wrote it: currently the update service retains the observer service and in certain unusual circumstances leaks it. It is relatively simple to get the observer service when you need it instead of keeping a reference around.
(Assignee)

Comment 1

13 years ago
Created attachment 212639 [details] [diff] [review]
Don't cache observerservice, rev. 1
Attachment #212639 - Flags: review?(darin)
Attachment #212639 - Flags: approval-branch-1.8.1?(darin)

Comment 2

13 years ago
Comment on attachment 212639 [details] [diff] [review]
Don't cache observerservice, rev. 1

>Index: toolkit/mozapps/update/src/nsUpdateService.js.in

>     case "xpcom-shutdown":
>+      Components.utils.reportError("xpcomshutdown!");
>+
>+      os.removeObserver(this, "xpcom-shutdown");

Why is this case an error?

I think this code would be slightly cleaner with a getObserverService
global function that can be called from these places instead.

r=darin w/ reportError removed or justified (please add a comment to
the code in the latter case)
Attachment #212639 - Flags: review?(darin)
Attachment #212639 - Flags: review+
Attachment #212639 - Flags: approval-branch-1.8.1?(darin)
Attachment #212639 - Flags: approval-branch-1.8.1+
(Assignee)

Comment 3

13 years ago
That error report was a debugging tool which I forgot to remove. Removed it, added a getObserverService() helper func, and FIXED on trunk and branch.
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.