Closed Bug 268371 Opened 20 years ago Closed 20 years ago

memory leak in nsLookAndFeel::GetMetric()

Categories

(Core Graveyard :: GFX: Gtk, defect)

x86
Linux
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: eagle.lu, Assigned: blizzard)

Details

(Keywords: memory-leak)

Attachments

(1 file, 1 obsolete file)

I use libumem.so to detect memory leaks and I found a memory leak in following
codes:
            GtkWidget* box = gtk_hbox_new(FALSE, 5);
            gint threshold = 0;

            g_object_get(gtk_widget_get_settings(box),
                         "gtk-dnd-drag-threshold", &threshold,
                         NULL);
            gtk_widget_destroy(box);
            aMetric = threshold;
Because hbox widget can be only be freed after it is put in container.
gtk_widget_destroy() can't detroy the box cleanly.
Attached patch add a container window (obsolete) — Splinter Review
Comment on attachment 165114 [details] [diff] [review]
add a container window

Can you give r? Thanks
Attachment #165114 - Flags: review?(blizzard)
Severity: normal → critical
Keywords: mlk
Summary: memory leak in nsLookAndFeel::GetMetric() → memory leak in nsLookAndFeel::GetMetric()
Attachment #165114 - Attachment is obsolete: true
Attachment #165114 - Flags: review?(blizzard) → review-
Comment on attachment 165659 [details] [diff] [review]
use gtk_object_sink() instead of creating a container

Can you give r? Thanks
Attachment #165659 - Flags: review?(pavlov)
Attachment #165659 - Flags: review?(pavlov) → review?(blizzard)
Attachment #165659 - Flags: review?(blizzard) → review+
Attachment #165659 - Flags: superreview?(rbs)
Attachment #165659 - Flags: superreview?(rbs) → superreview+
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Checking in nsLookAndFeel.cpp;
/cvsroot/mozilla/widget/src/gtk2/nsLookAndFeel.cpp,v  <--  nsLookAndFeel.cpp
new revision: 1.20; previous revision: 1.19
done
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: