summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Koegel <eric.koegel@gmail.com>2013-04-27 16:05:31 +0300
committerEric Koegel <eric.koegel@gmail.com>2013-04-27 16:06:19 +0300
commitc998210dc8cad6705843b37d1b72ae972a10671d (patch)
treecaa18925ad99805538227d932577f599ad7c0207
parent9dbec5220ff4e60dbd9ec4c8b528429f40a82616 (diff)
downloadxfdesktop-c998210dc8cad6705843b37d1b72ae972a10671d.tar.gz
Fix some memory leaks
-rw-r--r--src/xfdesktop-notify.c60
1 files changed, 34 insertions, 26 deletions
diff --git a/src/xfdesktop-notify.c b/src/xfdesktop-notify.c
index ae55a969..6cbcad37 100644
--- a/src/xfdesktop-notify.c
+++ b/src/xfdesktop-notify.c
@@ -215,27 +215,31 @@ xfdesktop_notify_unmount_finish (GMount *mount, gboolean unmount_successful)
g_object_set_data (G_OBJECT (mount), "xfdesktop-notification", NULL);
}
- /* if the unmount operation wasn't successful then stop here, otherwise
- * display a message letting the user know it has been removed */
- if(!unmount_successful)
- return;
-
- summary = _("Unmount Finished");
+ /* if the unmount operation was successful then display a message letting
+ * the user know it has been removed */
+ if (unmount_successful)
+ {
+ summary = _("Unmount Finished");
- message = g_strdup_printf (_("The device \"%s\" has been safely removed from the system. "), name);
+ message = g_strdup_printf (_("The device \"%s\" has been safely removed from the system. "), name);
#ifdef NOTIFY_CHECK_VERSION
#if NOTIFY_CHECK_VERSION (0, 7, 0)
- notification = notify_notification_new (summary, message, icon_name);
+ notification = notify_notification_new (summary, message, icon_name);
#else
- notification = notify_notification_new (summary, message, icon_name, NULL);
+ notification = notify_notification_new (summary, message, icon_name, NULL);
#endif
#else
- notification = notify_notification_new (summary, message, icon_name, NULL);
+ notification = notify_notification_new (summary, message, icon_name, NULL);
#endif
- notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL);
- notify_notification_set_timeout (notification, NOTIFY_EXPIRES_DEFAULT);
- notify_notification_show (notification, NULL);
+ notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL);
+ notify_notification_set_timeout (notification, NOTIFY_EXPIRES_DEFAULT);
+ notify_notification_show (notification, NULL);
+ }
+
+ g_free (message);
+ g_free (icon_name);
+ g_free (name);
}
@@ -395,27 +399,31 @@ xfdesktop_notify_eject_finish (GVolume *volume, gboolean eject_successful)
g_object_set_data (G_OBJECT (volume), "xfdesktop-notification", NULL);
}
- /* if the eject operation wasn't successful then stop here, otherwise
- * display a message letting the user know it has been removed */
- if(!eject_successful)
- return;
-
- summary = _("Eject Finished");
+ /* if the eject operation was successful then display a message letting the
+ * user know it has been removed */
+ if(eject_successful)
+ {
+ summary = _("Eject Finished");
- message = g_strdup_printf (_("The device \"%s\" has been safely removed from the system. "), name);
+ message = g_strdup_printf (_("The device \"%s\" has been safely removed from the system. "), name);
#ifdef NOTIFY_CHECK_VERSION
#if NOTIFY_CHECK_VERSION (0, 7, 0)
- notification = notify_notification_new (summary, message, icon_name);
+ notification = notify_notification_new (summary, message, icon_name);
#else
- notification = notify_notification_new (summary, message, icon_name, NULL);
+ notification = notify_notification_new (summary, message, icon_name, NULL);
#endif
#else
- notification = notify_notification_new (summary, message, icon_name, NULL);
+ notification = notify_notification_new (summary, message, icon_name, NULL);
#endif
- notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL);
- notify_notification_set_timeout (notification, NOTIFY_EXPIRES_DEFAULT);
- notify_notification_show (notification, NULL);
+ notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL);
+ notify_notification_set_timeout (notification, NOTIFY_EXPIRES_DEFAULT);
+ notify_notification_show (notification, NULL);
+ }
+
+ g_free (message);
+ g_free (icon_name);
+ g_free (name);
}