Closed
Bug 283116
Opened 20 years ago
Closed 20 years ago
browser.js Shutdown can have exception in removeObserver
Categories
(Firefox :: Tabbed Browser, defect, P1)
Firefox
Tabbed Browser
Tracking
()
RESOLVED
FIXED
Firefox1.5
People
(Reporter: dbaron, Assigned: dbaron)
References
Details
(Keywords: memory-leak, Whiteboard: [patch])
Attachments
(1 file, 2 obsolete files)
4.06 KB,
patch
|
mconnor
:
review+
|
Details | Diff | Splinter Review |
So the analysis in bug 283088 was at least partly incorrect.
In browser.js, the following two addObserver and removeObserver calls are
supposedly balanced:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/browser/base/content/browser.js&rev=1.382&mark=691-692#686
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/browser/base/content/browser.js&rev=1.382&mark=905#900
However, they're only really balanced if the last tab closed in a window is the
one that was there when it was opened.
I made the mistake of adding the second of these, which breaks the whole rest of
the Shutdown function.
If the addObserver call cited above is actually still needed, I'm really not
sure what needs to be done. However, I'm hoping that it's not still needed.
I'll look into it.
Assignee | ||
Updated•20 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → Firefox1.1
Assignee | ||
Comment 1•20 years ago
|
||
Here's an idea: let's not make the first browser window different from all the
rest and have the disablehistory="true" attribute, at let's not try to
duplicate everything browser.xml would do without that disablehistory="true".
I haven't found any regressions from this yet, but I've only been running it
briefly. It seems logical. If I do catch something, though, there's always
the workaround of changing the disablehistory attribute on that one browser
after startup...
Attachment #175099 -
Flags: review?(mconnor)
![]() |
||
Comment 2•20 years ago
|
||
Does the seamonkey tabbrowser have code like that too?
Assignee | ||
Comment 3•20 years ago
|
||
The equivalent seamonkey tabbrowser code is even messier and used to have
references to two bugs (bug 113076 and bug 139522) the second of which has
security implications.
Assignee | ||
Comment 4•20 years ago
|
||
...but that code doesn't have the problematic browser:purge-session-history
observer.
Comment 5•20 years ago
|
||
Comment on attachment 175099 [details] [diff] [review]
patch
I don't think this should break anything, but we should have lots of time to
pick up regressions if they happen.
I do agree that they shouldn't based on this, as cvs blame puts this as a perf
boost fix for blank homepages. I don't know if tinderboxen have about:blank as
homepages, but I doubt this should affect startup that much, especially as
compared to the downside on the other end.
Attachment #175099 -
Flags: review?(mconnor) → review+
Assignee | ||
Comment 6•20 years ago
|
||
(In reply to comment #5)
> I do agree that they shouldn't based on this, as cvs blame puts this as a perf
> boost fix for blank homepages.
Ah, I didn't see that in cvs blame anywhere. That actually does sound like a
valid reason (esp. if it prevents history from being loaded until after we've
shown the browser window). I'll look into this a bit more (since the
alternative is quite simple as well).
Assignee | ||
Comment 7•20 years ago
|
||
It actually does seem to make a startup order difference (and not just for
about:blank as a homepage). (I was looking at whether global history was
created before or after the first paint, and that creation probably involves
reading in the global history database.)
So this makes the code a little clearer (adds a comment and moves the
addObserver to along with the rest of the code), and adds the fix of removing
the disablehistory attribute dynamically.
Attachment #175099 -
Attachment is obsolete: true
Attachment #175181 -
Flags: review?(mconnor)
Assignee | ||
Comment 8•20 years ago
|
||
Comment on attachment 175181 [details] [diff] [review]
patch
there's something wrong here...
Attachment #175181 -
Flags: review?(mconnor) → review-
Comment 9•20 years ago
|
||
Comment on attachment 175181 [details] [diff] [review]
patch
r=me, just add a blank line before the comment about the disablehistory
attribute.
This is definitely a lot better, and given some of the mork perf issues with
loading global history with huge history files, it probably would make a bigger
impact than I was expecting.
Attachment #175181 -
Flags: review- → review+
Comment 10•20 years ago
|
||
Comment on attachment 175181 [details] [diff] [review]
patch
oops!
Attachment #175181 -
Flags: review+ → review-
Assignee | ||
Comment 11•20 years ago
|
||
I forgot to remove the removeObserver call.
Attachment #175181 -
Attachment is obsolete: true
Attachment #175186 -
Flags: review?(mconnor)
Assignee | ||
Comment 12•20 years ago
|
||
*** Bug 265906 has been marked as a duplicate of this bug. ***
Assignee | ||
Updated•20 years ago
|
Whiteboard: [patch]
Comment 13•20 years ago
|
||
Comment on attachment 175186 [details] [diff] [review]
patch
ok. same nit about the line before the disablehistory comment, mostly style
consistency
Attachment #175186 -
Flags: review?(mconnor) → review+
Assignee | ||
Comment 14•20 years ago
|
||
Fix checked in to trunk, 2005-02-22 17:35 -0800.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 15•20 years ago
|
||
Note that this was fixing a mistake I made in bug 239833.
You need to log in
before you can comment on or make changes to this bug.
Description
•