[gnome-calendar] misc: fix memory leak
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] misc: fix memory leak
- Date: Fri, 26 Dec 2014 17:07:01 +0000 (UTC)
commit b66d4eb21caeb62f9c195cb861202610bd28b724
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Fri Dec 26 12:01:53 2014 -0500
misc: fix memory leak
src/gcal-edit-dialog.c | 6 ++++--
src/gcal-month-view.c | 7 +++----
2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c
index 89226a7..06d02d2 100644
--- a/src/gcal-edit-dialog.c
+++ b/src/gcal-edit-dialog.c
@@ -804,6 +804,7 @@ gcal_edit_dialog_set_event_data (GcalEditDialog *dialog,
GcalEditDialogPrivate *priv;
GdkRGBA color;
+ GdkPixbuf *pix;
ESourceSelectable *extension;
const gchar *const_text = NULL;
@@ -870,8 +871,9 @@ gcal_edit_dialog_set_event_data (GcalEditDialog *dialog,
&color,
e_source_selectable_get_color (E_SOURCE_SELECTABLE (extension)));
- gtk_image_set_from_pixbuf (GTK_IMAGE (priv->source_image),
- gcal_get_pixbuf_from_color (&color, 16));
+ pix = gcal_get_pixbuf_from_color (&color, 16);
+ gtk_image_set_from_pixbuf (GTK_IMAGE (priv->source_image), pix);
+ g_object_unref (pix);
gtk_header_bar_set_subtitle (GTK_HEADER_BAR (priv->titlebar),
e_source_get_display_name (data->source));
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index 0b24ee3..eee5c9e 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -889,7 +889,6 @@ gcal_month_view_size_allocate (GtkWidget *widget,
gtk_style_context_get (gtk_widget_get_style_context (widget), gtk_widget_get_state_flags (widget),
"font", &font_desc, "padding-bottom", &padding_bottom, NULL);
- layout = pango_layout_new (gtk_widget_get_pango_context (widget));
layout = gtk_widget_create_pango_layout (widget, _("Other events"));
pango_layout_set_font_description (layout, font_desc);
pango_layout_get_pixel_size (layout, NULL, &font_height);
@@ -1055,7 +1054,7 @@ gcal_month_view_size_allocate (GtkWidget *widget,
child_allocation.height = natural_height;
gtk_widget_show (child_widget);
gtk_widget_size_allocate (child_widget, &child_allocation);
- g_hash_table_remove (priv->hidden_as_overflow, g_strdup (uuid));
+ g_hash_table_remove (priv->hidden_as_overflow, uuid);
size_left[i] -= natural_height;
}
@@ -1678,7 +1677,7 @@ gcal_month_view_remove (GtkContainer *container,
GList *l, *aux;
gboolean was_visible = FALSE;
GtkWidget *master_widget;
- icaltimetype *date;
+ const icaltimetype *date;
g_return_if_fail (gtk_widget_get_parent (widget) == GTK_WIDGET (container));
priv = gcal_month_view_get_instance_private (GCAL_MONTH_VIEW (container));
@@ -1708,7 +1707,7 @@ gcal_month_view_remove (GtkContainer *container,
}
else
{
- date = gcal_event_widget_get_date (GCAL_EVENT_WIDGET (widget));
+ date = gcal_event_widget_peek_start_date (GCAL_EVENT_WIDGET (widget));
aux = g_hash_table_lookup (priv->single_day_children, GINT_TO_POINTER (date->day));
aux = g_list_remove (g_list_copy (aux), widget);
if (aux == NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]