The default bug view has changed. See this FAQ.

nsToolkit::StartAllowingD3D9 leaks the nsToolkit object

RESOLVED FIXED in mozilla10

Status

()

Core
Graphics
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

({mlk})

Trunk
mozilla10
x86
Windows 7
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
The leak is pretty obvious, NS_GetCurrentToolkit AddRef's, nothing Release's.  Pretty classic.

Here's how we found out about this.  This leak turned the WinXP debug reftest permaorange when we enabled optimizations for debug builds.  It turns out that nsToolkit::StartAllowingD3D9 is only called if we request a persistent layer manager before the 5 second timer for allowing D3D9 fires.  One of the things which requires persistent layer managers are canvas elements, which are used by the reftest framework.  So, if the reftest framework manages to run its first test before 5 seconds has passed since the startup, we leak the nsToolkit object.  Turning on optimizations on debug builds just made Firefox faster by enough margin to trigger this leak.
(Assignee)

Comment 1

6 years ago
Created attachment 564865 [details] [diff] [review]
Patch (v1)
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #564865 - Flags: review?(roc)
(Assignee)

Updated

6 years ago
Blocks: 595277
Comment on attachment 564865 [details] [diff] [review]
Patch (v1)

Review of attachment 564865 [details] [diff] [review]:
-----------------------------------------------------------------

Add MOZ_COUNT_CTOR/DTOR to the nsToolkit implementations?
Attachment #564865 - Flags: review?(roc) → review+
Comment on attachment 564865 [details] [diff] [review]
Patch (v1)

Review of attachment 564865 [details] [diff] [review]:
-----------------------------------------------------------------

Add MOZ_COUNT_CTOR/DTOR to the nsToolkit implementations?
https://hg.mozilla.org/mozilla-central/rev/fd00836252be
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
OS: Mac OS X → Windows 7
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
You need to log in before you can comment on or make changes to this bug.