Closed Bug 692122 Opened 13 years ago Closed 13 years ago

nsToolkit::StartAllowingD3D9 leaks the nsToolkit object

Categories

(Core :: Graphics, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla10

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

(Keywords: memory-leak)

Attachments

(1 file)

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.
Attached patch Patch (v1)Splinter Review
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #564865 - Flags: review?(roc)
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
Closed: 13 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.

Attachment

General

Created:
Updated:
Size: