Closed
Bug 14450
Opened 25 years ago
Closed 24 years ago
XULDocumentImpl dtor does not call DocumentWillBeDestroyed
Categories
(Core Graveyard :: RDF, defect, P3)
Core Graveyard
RDF
Tracking
(Not tracked)
VERIFIED
WONTFIX
People
(Reporter: hjtoi-bugzilla, Assigned: waterson)
Details
Attachments
(1 file)
879 bytes,
patch
|
Details | Diff | Splinter Review |
Shouldn't documents call the DocumentWillBeDestroyed method of its document observers when it is being destroyed? Thanks to jst@citec.fi for help in tracking this one down, and the fix (will attach).
Reporter | ||
Comment 1•25 years ago
|
||
Assignee | ||
Updated•25 years ago
|
Assignee: waterson → heikki
Assignee | ||
Comment 2•25 years ago
|
||
Heikki: if this patch works, then please check it in. Looks good to me.
Waterson: (I'm answering on Heikkis behaf since he's leaving for a conferance tomorrow morning and might not see this untill early next week) AFAIK heikki does not have a CVS account (and neither do I) so he can't check it in, so if you can, please check it in, I did verify that it both compiles and works (on win32).
Reporter | ||
Updated•25 years ago
|
Assignee: heikki → waterson
Reporter | ||
Comment 4•25 years ago
|
||
Since I do not have CVS checkin rights, I am assigning this back to waterson. (By the way Johnny, waterson did not see your message as he was not on the list of people that get copies of changes in this bug. Remember to check assigned, reporter, cc and QA fields ;)
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M11
Assignee | ||
Comment 5•25 years ago
|
||
ok then. thanks for the patch!
Oops, sorry about that, I assumed that since it had been assigned to waterson he would still get notified about status changes to the bug.
Comment 7•25 years ago
|
||
what are some good ways to test this patch?
Assignee | ||
Comment 8•25 years ago
|
||
it does not need to be tested. it is the right thing to do.
Reporter | ||
Comment 9•25 years ago
|
||
If you are interested, here is how this bug was found and verified to be true: I created a window. I wanted to know when the user closed the window. I grabbed the XUL document of the opened window and added a document observer to it. Once the user closes the window, the XUL document gets destroyed and it should (and with the fix it does) call the observer's DocumentWillBeDestroyed() method. If you look at nsDocument you will notice it does the same thing.
Assignee | ||
Comment 10•25 years ago
|
||
As an additional data point, I accidentally checked this in (unapproved) with another bug fix. Turns out that on Mac, it causes a crash-on-exit (see 14911). We'll need to get that sorted out before landing this. My guess is native menu observers are doing something bad, like not removing themselves as document observers when they get destroyed.
Comment 11•25 years ago
|
||
I just took a look at nsXULDocument.cpp and around line 1988 (just above AddObserver) there's a comment that says that the document doesn't keep a reference to the document observer, in stead the document observer keeps a live reference to the document! If this is the case then calling DocumentWillBeDestroyed on the observers from the document destructor wouldn't work since as long as one or more observers keep a reference to the document the document wouldn't be destroyed!!! This is confusing and IMO this can not work! IMO the document should keep a strong reference to the observers and the observers should keep weak references to the document. This way one could an observer that is constructed, added as an observer to a document and then deleted with the document unless there are other references to the observer. This is what observers are for (among other things) right! nsDocument has this same problem.
Assignee | ||
Comment 12•25 years ago
|
||
bulldozer to M12
Assignee | ||
Updated•25 years ago
|
Target Milestone: M13 → M14
Assignee | ||
Updated•24 years ago
|
Target Milestone: M14 → M20
Reporter | ||
Comment 13•24 years ago
|
||
Um, have you checked this on the Mac lately? Bug 14911 was marked fixed, but has the situation changed so this fix could be checked in?
Assignee | ||
Comment 14•24 years ago
|
||
i don't know. try it. it's wrapped in an #ifdef.
Reporter | ||
Comment 15•24 years ago
|
||
I can't, I don't have any suitable Macs I could use :/
Assignee | ||
Comment 16•24 years ago
|
||
marking WONTFIX. this caused problems, and I'm under the impression that none of the content models do this. let me know if i'm wrong.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → WONTFIX
Updated•6 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•