Closed Bug 617639 Opened 9 years ago Closed 9 years ago

Hopefully useless null check in PresShell::SetIsActive for mDocument or [@ PresShell::UpdateImageLockingState | PresShell::SetIsActive]

Categories

(Core :: Layout, defect, trivial)

defect
Not set
trivial

Tracking

()

RESOLVED FIXED
mozilla2.0b8

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug)

Details

(Keywords: coverity)

Attachments

(1 file)

9242 PresShell::SetIsActive(PRBool aIsActive)
9243 {

9252   if (mDocument) {
9253     mDocument->EnumerateExternalResources(SetExternalResourceIsActive,
9254                                           &aIsActive);
9255   }

this will crash if !mDocument:
9256   return UpdateImageLockingState();
9257 }
9258 
9259 /*
9260  * Determines the current image locking state. Called when one of the
9261  * dependent factors changes.
9262  */
9263 nsresult
9264 PresShell::UpdateImageLockingState()
9265 {
9266   // We're locked if we're both thawed and active.
right here:
9267   return mDocument->SetImageLockingState(!mFrozen && mIsActive);
I believe we never enter this code if !mDocument.
bz: this being different than bug 602516?
Severity: critical → trivial
Keywords: crash
OS: Mac OS X → Windows XP
Summary: [@ PresShell::UpdateImageLockingState | PresShell::SetIsActive] if !mDocument → Hopefully useless null check in PresShell::SetIsActive for mDocument or [@ PresShell::UpdateImageLockingState | PresShell::SetIsActive]
Attached patch patchSplinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #496372 - Flags: review?(bzbarsky)
Attachment #496372 - Flags: approval2.0?
Comment on attachment 496372 [details] [diff] [review]
patch

Yes, this is different from Freeze().
Attachment #496372 - Flags: review?(bzbarsky)
Attachment #496372 - Flags: review+
Attachment #496372 - Flags: approval2.0?
Attachment #496372 - Flags: approval2.0+
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/bffd8632295e
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Keywords: checkin-needed
OS: Windows XP → All
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
You need to log in before you can comment on or make changes to this bug.