Re: Help with GtkBuilder memory leak
- From: Emmanuele Bassi <ebassi gmail com>
- To: Giovanni Panozzo <giovanni panozzo it>
- Cc: "gtk-app-devel-list gnome org" <gtk-app-devel-list gnome org>
- Subject: Re: Help with GtkBuilder memory leak
- Date: Thu, 2 Jun 2016 16:32:42 +0100
Hi;
you're missing a `g_object_unref()` inside the `activate` handler:
On 2 June 2016 at 16:03, Giovanni Panozzo <giovanni panozzo it> wrote:
I'm trying to identify some memory leaks of my application using
-fsanitize=address of GCC.
Use Valgrind, instead.
static void
activate (GtkApplication* app,
gpointer user_data)
{
GtkBuilder* b;
b = gtk_builder_new_from_file("builderleak.glade");
w = GTK_APPLICATION_WINDOW(gtk_builder_get_object(b, "mainwin"));
g_object_set(w, "application", app, NULL);
g_object_unref (b);
}
You also may want to look into using GtkBuilder templates, and your
own GtkApplicationWindow subclass.
Ciao,
Emmanuele.
--
https://www.bassi.io
[ ] ebassi [ gmail com]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]