[gnac/devel] Fixed memory leaks
- From: Benoît Dupasquier <bdupasqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnac/devel] Fixed memory leaks
- Date: Sat, 16 Oct 2010 10:51:04 +0000 (UTC)
commit e8f6d06c0511a5f1be0d23b4a2373251ad402fa6
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date: Sat Oct 16 11:50:57 2010 +0100
Fixed memory leaks
libgnac/libgnac-converter.c | 4 ++++
src/gnac-ui.c | 7 ++++++-
2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/libgnac/libgnac-converter.c b/libgnac/libgnac-converter.c
index ab16a60..c6b470c 100644
--- a/libgnac/libgnac-converter.c
+++ b/libgnac/libgnac-converter.c
@@ -288,11 +288,14 @@ libgnac_converter_set_property(GObject *object,
break;
case PROP_RENAME_PATTERN:
+ g_free(self->priv->rename_pattern);
+ self->priv->rename_pattern = NULL;
self->priv->rename_pattern = g_value_dup_string(value);
break;
case PROP_FOLDER_HIERARCHY:
g_free(self->priv->folder_hierarchy);
+ self->priv->folder_hierarchy = NULL;
self->priv->folder_hierarchy = g_value_dup_string(value);
break;
@@ -302,6 +305,7 @@ libgnac_converter_set_property(GObject *object,
case PROP_FOLDER_PATH:
g_free(self->priv->folder_path);
+ self->priv->folder_path = NULL;
self->priv->folder_path = g_value_dup_string(value);
break;
diff --git a/src/gnac-ui.c b/src/gnac-ui.c
index e719455..baef1c2 100644
--- a/src/gnac-ui.c
+++ b/src/gnac-ui.c
@@ -709,6 +709,7 @@ gnac_ui_push_status(const gchar *message)
status_bar = GTK_STATUSBAR(
gtk_builder_get_object(gnac_main_builder, "statusbar"));
+ g_free(status_msg);
status_msg = g_strdup(message);
gtk_statusbar_pop(status_bar, 0);
gtk_statusbar_push(status_bar, 0, status_msg);
@@ -718,11 +719,15 @@ gnac_ui_push_status(const gchar *message)
void
gnac_ui_append_status(const gchar *message)
{
+ gchar *old_msg;
GtkStatusbar *status_bar;
status_bar = GTK_STATUSBAR(
gtk_builder_get_object(gnac_main_builder, "statusbar"));
- status_msg = g_strdup_printf("%s (%s)", status_msg, message);
+ old_msg = g_strdup(status_msg);
+ g_free(status_msg);
+ status_msg = g_strdup_printf("%s (%s)", old_msg, message);
+ g_free(old_msg);
gtk_statusbar_pop(status_bar, 0);
gtk_statusbar_push(status_bar, 0, status_msg);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]