Closed Bug 487955 Opened 15 years ago Closed 15 years ago

nsLookAndFeel leaks one GtkInvisible (shutdown leak)

Categories

(Core :: Widget: Gtk, defect, P5)

All
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

(Keywords: memory-leak)

Attachments

(1 file)

Attached patch patchSplinter Review
I've had a patch to fix this in my tree for ages, but I just realized that I could make the patch a bit cleaner and not depend on how quirky GtkInvisible is by just using the normal pattern as though GtkInvisible were a normal widget.  (See comments in patch.)

This patch also changes the lifetime of the GtkInvisible in question; instead of keeping it around for the lifetime of the app and holding a weak pointer to its style, it instead copies the style and then destroys the GtkInvisible immediately.
Attachment #372241 - Flags: superreview?(roc)
Attachment #372241 - Flags: review?(mozbugz)
Comment on attachment 372241 [details] [diff] [review]
patch

I don't think this needs sr really...
Attachment #372241 - Flags: superreview?(roc) → superreview+
Attachment #372241 - Flags: review?(mozbugz) → review+
Comment on attachment 372241 [details] [diff] [review]
patch

I'm not sure that the copy is necessary, but at least with a copy we don't need to worry about it being changed.

>+        // done.  (Though we could skip the g_object_ref_sink and the
>+        // corresponding g_object_unref, but that's particular to
>+        // GtkInvisibles.)

AFAIK its particular to GtkWindows and GtkInvisibles.

I'm guessing the general idea was the gtk_widget_destroy should normally be enough for client apps, as non-toplevel widgets are expected to always be added to a container.  Mozilla is not a normal client app and so needs to think more about floating references, which would normally be handled internally by GTK.
http://hg.mozilla.org/mozilla-central/rev/f88f710bdd76
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Priority: -- → P5
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: