don't leak 'filename' field memory when loading more than one file into

2007-11-08  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkbuilder.c: don't leak 'filename' field memory when loading
        more than one file into the same GtkBuilder instance. Noticed by
        Ryan Lortie.


svn path=/trunk/; revision=18973
This commit is contained in:
Matthias Clasen 2007-11-09 00:33:45 +00:00 committed by Matthias Clasen
parent d5dca93c58
commit fb4b0ddff7
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2007-11-08 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkbuilder.c: don't leak 'filename' field memory when loading
more than one file into the same GtkBuilder instance. Noticed by
Ryan Lortie.
2007-11-08 Michael Natterer <mitch@imendio.com>
* gtk/gtkbuildable.h: include <glib.h> instead of <glib/gmarkup.h>

View File

@ -660,6 +660,7 @@ gtk_builder_add_from_file (GtkBuilder *builder,
return 0;
}
g_free (builder->priv->filename);
builder->priv->filename = g_strdup (filename);
_gtk_builder_parser_parse_buffer (builder, filename,
@ -704,6 +705,7 @@ gtk_builder_add_from_string (GtkBuilder *builder,
tmp_error = NULL;
g_free (builder->priv->filename);
builder->priv->filename = g_strdup (".");
_gtk_builder_parser_parse_buffer (builder, "<input>",