Closed Bug 593530 Opened 9 years ago Closed 9 years ago

[D3D9] mDeviceManager is leaked if initialization fails

Categories

(Core :: Graphics, defect)

x86
Windows 7
defect
Not set

Tracking

()

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

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

References

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
Attached patch Use nsRefPtr for mDeviceManager (obsolete) — Splinter Review
Attachment #472069 - Flags: review?(joe)
Comment on attachment 472069 [details] [diff] [review]
Use nsRefPtr for mDeviceManager

It's dangerous to have an nsRefPtr that's statically allocated, because we will Release and delete it at quit() time rather than when xpcom is torn down. Further, we shouldn't manually AddRef and Release an nsRefPtr.

Probably the best solution here is to delete mDeviceManager before setting the pointer to nsnull if Init() fails. That's *always* a leak, and it seems like the least bad fix to a rather bad situation.
Attachment #472069 - Flags: review?(joe) → review-
We need this because, on win2k3 test machines, Direct3D 9 fails to initialize, and we then get orange on everything because we leak the device manager.
blocking2.0: --- → beta6+
http://hg.mozilla.org/mozilla-central/rev/4051f53e8007
Assignee: nobody → matt.woodrow+bugzilla
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.