mWindowGroup leaked in gtk2's nsWindow

RESOLVED DUPLICATE of bug 398940

Status

()

RESOLVED DUPLICATE of bug 398940
13 years ago
11 years ago

People

(Reporter: ajschult784, Unassigned)

Tracking

({memory-leak})

Trunk
x86
Linux
memory-leak
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
trace-malloc sees a few leaks starting out in gtk_window_group_new called from nsWindow::NativeCreate like
 malloc
 g_malloc
 g_mem_chunk_alloc
 g_mem_chunk_alloc0
 g_type_create_instance
 /usr/lib/libgobject-2.0.so.0+D5A1
 g_object_newv
 g_object_new_valist
 g_object_new
 gtk_window_group_new
 nsWindow::NativeCreate

AFAICT, nsWindow never destroys the GtkWindowGroup it creates (when it does create it).  mWindowGroup is set to nsnull in Destroy and there's a comment about how that will "work", but I can't see why it would help.
(Reporter)

Comment 1

13 years ago
Created attachment 220248 [details]
leak log

OK, I stepped through with the debugger and the code (as is) leaves mWindowGroup with a refcnt of 1.  I added a g_object_unref call, which takes the refcnt to 0, but the leaks remain, suggesting things are more complex than I supposed.  This is the trace-malloc leak info for the gtk_window_group_new leaks.
They're all being leaked from CreateHiddenWindow, which suggests the problem is a failure to tear down the hidden window.
I think the idea is that the window group is unrefed when the GTK widget is destroyed later in Destroy().

You could check whether DestroyHiddenWindow is getting called at all, and if it is, why the window group is getting destroyed when the hidden window's GTK widget is destroyed.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 398940
You need to log in before you can comment on or make changes to this bug.