Closed Bug 565360 Opened 14 years ago Closed 14 years ago

crash [@ ContainerLayerOGL::RemoveChild] when removing the last child

Categories

(Core :: Graphics, defect)

defect
Not set
critical

Tracking

()

RESOLVED DUPLICATE of bug 568150

People

(Reporter: timeless, Assigned: timeless)

References

()

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

85 void
86 ContainerLayerOGL::RemoveChild(Layer *aChild)
87 {
88   if (GetFirstChild() == aChild) {
89     mFirstChild = GetFirstChildOGL()->GetNextSibling()->GetLayer();

By induction, when you get around to removing the last child, NextSibling is null, and thus calling null->GetLayer() doesn't work well.

This was found because coverity complained about the code below, but I haven't seen coverity complaining about this yet, so I'm taking the credit.
Attached patch patchSplinter Review
this also fixes the indentation (and trailing whitespace) of the following for loop because that loop increment confused both myself and my neighbor by being underindented.
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #444909 - Flags: review?(bas.schouten)
Attachment #444909 - Flags: review?(bas.schouten) → review+
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Crash Signature: [@ ContainerLayerOGL::RemoveChild]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: