Closed Bug 326959 Opened 18 years ago Closed 18 years ago

menupopup.enableRollup(true) causes crash [@ nsPopupSetFrame::Destroy]

Categories

(Core :: XUL, defect)

defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla1.9alpha1

People

(Reporter: jruderman, Assigned: asqueella)

References

Details

(Keywords: crash, testcase)

Crash Data

Attachments

(3 files, 2 obsolete files)

 
Attached file testcase
Summary: menupopup.enableRollup(true) causes crash → menupopup.enableRollup(true) causes crash [@ nsPopupSetFrame::Destroy]
Attached patch patch (obsolete) — Splinter Review
The crash happens because EnableRollup is written to be called only when the the popup in question is already open. (Otherwise, it creates the nsMenuDismissalListener, but doesn't set its CurrentMenuParent, meaning the created object is in pretty broken state.)

I changed enableRollup implementation to be a bit less fragile. It still only has effect when the popup it's called on is open, but it now allows calling EnableRollup multiple times (also when the popup is not open), without getting into broken state.

(ignore the chunk in nsMenuFrame::SetInitialChildList, it is for bug 330456)
(I'm still new to mozilla's C++ and this code in particular, so please review with care :)

By the way, this code assumed (and assumes) that all the open popups are in the same "chain". Is it correct assumption and should bugs be filed when this isn't the case?
Assignee: nobody → asqueella
Status: NEW → ASSIGNED
Attachment #215813 - Flags: superreview?(roc)
Attachment #215813 - Flags: review?(neil)
Comment on attachment 215813 [details] [diff] [review]
patch

>-nsMenuBarFrame :: KillPendingTimers ( )
>+nsMenuBarFrame::KillPendingTimers ( )
I'm not a fan of random cleanup.

I'm not sure I really understand dismissal listeners. I don't suppose you can explain why we need to be able to have a listener without a menu parent?
> I'm not sure I really understand dismissal listeners. I don't suppose you can
> explain why we need to be able to have a listener without a menu parent?

We don't need that. The null-check in nsPopupSetFrame::Destroy can be removed, not sure why I added it :-/

Attached patch patch v2 (obsolete) — Splinter Review
Without the null-check and with fewer jst-review nits.
Attachment #215813 - Attachment is obsolete: true
Attachment #215919 - Flags: superreview?(roc)
Attachment #215919 - Flags: review?(neil)
Attachment #215813 - Flags: superreview?(roc)
Attachment #215813 - Flags: review?(neil)
Attachment #215919 - Flags: superreview?(roc) → superreview+
Comment on attachment 215919 [details] [diff] [review]
patch v2

Seems okay then.
Attachment #215919 - Flags: review?(neil) → review+
OS: MacOS X → All
Hardware: Macintosh → All
Whiteboard: [checkin needed]
Target Milestone: --- → mozilla1.9alpha
Without the whitespace change in KillPendingTimers and the change for bug 330456.
Attachment #215919 - Attachment is obsolete: true
Checked in by timeless.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Verified FIXED using build 2006-03-24-04 of SeaMonkey trunk on Windows XP; no longer crashing.
Status: RESOLVED → VERIFIED
Depends on: 354300
*** Bug 305423 has been marked as a duplicate of this bug. ***
Component: XP Toolkit/Widgets: Menus → XUL
QA Contact: xptoolkit.menus → xptoolkit.widgets
Crash Signature: [@ nsPopupSetFrame::Destroy]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: