Closed Bug 980415 Opened 6 years ago Closed 6 years ago

Fix multiple points in the codebase where we fail to call DataSourceSurface::Unmap()

Categories

(Core :: Graphics, defect)

29 Branch
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: jwatt, Assigned: jwatt)

References

Details

Attachments

(1 file)

Care needs to be taken when using DataSourceSurface::Map() because we need to have a corresponding DataSourceSurface::Unmap() call to unlock the DataSourceSurface. Multiple points in the codebase have failed to ensure they always call Unmap(), usually because the function calling Map() has a return point that fails to call Unmap() (sometimes the return point is hidden by an NS_ENSURE_* macro). Anyway, we should fix the existing points in the code.
This covers most callers. There's at least one other broken caller in widget/windows/nsDragService.cpp but that seems more widely broken so I'll deal with that in a separate bug.
Attachment #8386896 - Flags: review?(bas)
This patch also fixes callers that test for success by checking map.mData - that's wrong since map.mData can be untouched (uninitialized) if Map() returned false.
Blocks: 980428
Attachment #8386896 - Flags: review?(bas) → review+
https://hg.mozilla.org/mozilla-central/rev/b8f0eb5251eb
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.