Closed Bug 1142659 Opened 5 years ago Closed 5 years ago

Leaks in TestLayers Layers::UserData test

Categories

(Core :: Graphics: Layers, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: erahm, Assigned: nical)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: [MemShrink:P3][CID 1286285][CID 1285991][CID 1286491][CID 1286734][gfx-noted])

Attachments

(1 file)

Note: this is just in test code

Coverity is noting leaks of |layerPtr|, |data(1,2,3)| [1] if various assertions are hit and the test returns before the final |delete|.

There are a couple of options to work around this:
- Convert ASSERT_* -> EXPECT_*, then the code will run until completion
- Get rid of |layerPtr| and just stack allocate the layer, move the creation of the data to where it's used
- Wrap the values in UniquePtr, use |UniquePtr::release| when adding the data

[1] https://hg.mozilla.org/mozilla-central/annotate/0190a1d17294/gfx/tests/gtest/TestLayers.cpp#l132
Assignee: nobody → nical.bugzilla
Whiteboard: [MemShrink][CID 1286285][CID 1285991][CID 1286491][CID 1286734] → [MemShrink][CID 1286285][CID 1285991][CID 1286491][CID 1286734][gfx-noted]
Attached patch Fix.Splinter Review
Attachment #8578649 - Flags: review?(jmuizelaar)
Attachment #8578649 - Flags: review?(jmuizelaar) → review+
Whiteboard: [MemShrink][CID 1286285][CID 1285991][CID 1286491][CID 1286734][gfx-noted] → [MemShrink:P3][CID 1286285][CID 1285991][CID 1286491][CID 1286734][gfx-noted]
https://hg.mozilla.org/mozilla-central/rev/32249d9b4056
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.