[gnac/devel] Fixed a memory leak
- From: Benoît Dupasquier <bdupasqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnac/devel] Fixed a memory leak
- Date: Tue, 12 Oct 2010 14:02:01 +0000 (UTC)
commit 8402c0216974f6e90a2515a2d12273cc37a37697
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date: Tue Oct 12 15:01:54 2010 +0100
Fixed a memory leak
m4/intltool.m4 | 2 +-
src/gnac-prefs.c | 12 ++++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/m4/intltool.m4 b/m4/intltool.m4
index 122d773..839e855 100644
--- a/m4/intltool.m4
+++ b/m4/intltool.m4
@@ -172,7 +172,7 @@ IT_PO_SUBDIR([po])
AC_DEFUN([IT_PO_SUBDIR],
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
dnl
-dnl The following CONFIG_COMMANDS should be exetuted at the very end
+dnl The following CONFIG_COMMANDS should be executed at the very end
dnl of config.status.
AC_CONFIG_COMMANDS_PRE([
AC_CONFIG_COMMANDS([$1/stamp-it], [
diff --git a/src/gnac-prefs.c b/src/gnac-prefs.c
index 94dcd33..fbaca15 100644
--- a/src/gnac-prefs.c
+++ b/src/gnac-prefs.c
@@ -434,13 +434,15 @@ void
gnac_prefs_selected_radio_toggled(GtkWidget *widget,
gpointer data)
{
+ gchar *uri;
GtkWidget *filechooserbutton;
filechooserbutton = GTK_WIDGET(gtk_builder_get_object(gnac_prefs_builder,
"filechooserbutton"));
+ uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(filechooserbutton));
gnac_prefs_set_selected_mode();
gnac_gconf_set_int(GNAC_GCONF_FOLDER_TYPE, FOLDER_SELECTED);
- gnac_gconf_set_string(GNAC_GCONF_DESTINATION_DIRECTORY,
- gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(filechooserbutton)));
+ gnac_gconf_set_string(GNAC_GCONF_DESTINATION_DIRECTORY, uri);
+ g_free(uri);
}
@@ -448,11 +450,13 @@ void
gnac_prefs_selected_uri_changed(GtkWidget *widget,
gpointer data)
{
+ gchar *uri;
GtkWidget *filechooserbutton;
filechooserbutton = GTK_WIDGET(gtk_builder_get_object(gnac_prefs_builder,
"filechooserbutton"));
- gnac_gconf_set_string(GNAC_GCONF_DESTINATION_DIRECTORY,
- gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(filechooserbutton)));
+ uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(filechooserbutton));
+ gnac_gconf_set_string(GNAC_GCONF_DESTINATION_DIRECTORY, uri);
+ g_free(uri);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]