Closed Bug 536486 Opened 15 years ago Closed 14 years ago

ClearMouseCapture seems to leak gCaptureInfo.mContent

Categories

(Core :: Layout, defect, P2)

x86
macOS
defect

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- beta1+

People

(Reporter: bzbarsky, Assigned: enndeakin)

References

Details

(Keywords: memory-leak)

Attachments

(1 file)

From mail to Neil and his response:

> Neil,
>
> I'm trying to understand the ownership model of gCaptureInfo.mContent. Why
> does PresShell::ClearMouseCapture sometimes release it and sometimes not? 
> Can this not lead to leaks?  I'm especially looking at the
> IsDestroyingFrames() codepath.

Looks like that path should be releasing mContent as well.

Overall, ClearMouseCapture should always be releasing unless the captured content is outside the view passed in.
Considering bug 500882, the IsDestroyingFrames check could just be removed. It's only there to avoid an assertion. mContent will end up getting cleared if it has no frame in the next code block.
Attachment #419418 - Flags: review?(roc)
If it's avoiding an assertion, we can't just remove it.
(In reply to comment #4)
> If it's avoiding an assertion, we can't just remove it.

The assertion (from nsFrameManager::GetPrimaryFrameFor) no longer exists.
Comment on attachment 419418 [details] [diff] [review]
remove this check

Ah great :-)
Attachment #419418 - Flags: review?(roc) → review+
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
blocking2.0: ? → beta1
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: