Closed Bug 1028134 Opened 10 years ago Closed 10 years ago

Remove dangerous public destructor of gfxContext

Categories

(Core :: Graphics, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: bjacob, Assigned: jfkthame)

References

Details

Attachments

(1 file, 1 obsolete file)

In bug 1027251 we removed all dangerous public destructors of XPCOM-refcounted classes outside of a finite whitelist, see HasDangerousPublicDestructor. Now we are going over the entries in this whitelist.

One of them is: gfxContext
AFAICS, there's no need for this destructor to be public; we can simply move it to private and drop it from the whitelist.
Attachment #8443683 - Flags: review?(bjacob)
Comment on attachment 8443683 [details] [diff] [review]
Remove dangerous public destructor of gfxContext.

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

Great, I somehow got confused into thinking that this would not be so trivial, but if this builds on tryserver then I was wrong. (FWIW when I tried locally that was on Linux).
Attachment #8443683 - Flags: review?(bjacob) → review+
It builds for me on OS X; I've sent it to tryserver to see what the other platforms think: https://tbpl.mozilla.org/?tree=Try&rev=3054fc5aeaee.
Turns out you're right, Linux doesn't like it. :(
IIRC BenWa might have ideas about why gfxContexts are managed not-by-refcounting.
The gfxPlatformGtk issue, at least, looks like an easy fix. But I'll wait to hear from the other platforms before posting a new patch.
No, I was saying it would be nice if classes like gfxContext didn't require a heap allocation but ATM they do. They are -not- safe to be used on the stack. Please land this patch and fix all the stack usage of this. It would be nice to land this with the DISALLOW_STACK_ALLOCATION something macro.
Attachment #8443683 - Attachment is obsolete: true
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Attachment #8443749 - Flags: review?(bjacob) → review+
https://hg.mozilla.org/mozilla-central/rev/93cd05e483cd
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: