diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-03-01 20:19:21 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-03-01 20:19:21 -0600 |
commit | 9e8aae213e7a3ced1b6ec8b6b48a9bd69532e709 (patch) | |
tree | 9c682e5d872a4511dd1008c3c3b24dddf8bcbe0c | |
parent | 25e9f143eef355cbcb4b3cb7563e28414c4a93a4 (diff) | |
download | ayatana-indicator-datetime-9e8aae213e7a3ced1b6ec8b6b48a9bd69532e709.tar.gz ayatana-indicator-datetime-9e8aae213e7a3ced1b6ec8b6b48a9bd69532e709.tar.bz2 ayatana-indicator-datetime-9e8aae213e7a3ced1b6ec8b6b48a9bd69532e709.zip |
fix memory leak in update_appointment_menu_items()
-rw-r--r-- | src/datetime-service.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c index 3416008..438bf5d 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -727,7 +727,6 @@ update_appointment_menu_items (gpointer user_data) updating_appointments = TRUE; time_t curtime = 0, t1 = 0, t2 = 0; - gchar *ad; GList *l; GSList *g; GError *gerror = NULL; @@ -894,7 +893,7 @@ update_appointment_menu_items (gpointer user_data) struct comp_instance *ci = l->data; ECalComponent *ecalcomp = ci->comp; ECalComponentText valuetext; - gchar *summary, *cmd; + gchar *summary; char right[20]; //const gchar *uri; DbusmenuMenuitem * item; @@ -995,12 +994,12 @@ update_appointment_menu_items (gpointer user_data) // Now we pull out the URI for the calendar event and try to create a URI that'll work when we execute evolution // FIXME Because the URI stuff is really broken, we're going to open the calendar at todays date instead //e_cal_component_get_uid(ecalcomp, &uri); - ad = isodate_from_time_t(mktime(due)); - cmd = g_strconcat("evolution calendar:///?startdate=", ad, NULL); - g_signal_connect (G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, - G_CALLBACK (activate_cb), cmd); - + gchar * ad = isodate_from_time_t(mktime(due)); + gchar * cmd = g_strconcat("evolution calendar:///?startdate=", ad, NULL); g_debug("Command to Execute: %s", cmd); + g_signal_connect_data (G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, + G_CALLBACK(activate_cb), cmd, (GClosureNotify)g_free, 0); + g_free (ad); const gchar *color_spec = e_source_peek_color_spec(ci->source); g_debug("Colour to use: %s", color_spec); |