From: Emmanuel Rodriguez Date: Tue, 28 Apr 2009 17:28:27 +0000 (+0200) Subject: MemChecker: error when freeing a color X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13de7bc5d3a1d1a2af5197b2468eea12c61daf58;p=libchamplain MemChecker: error when freeing a color ClutterColors have to be allocated with clutter_color_copy, which will use g_slice instead of g_new. --- diff --git a/champlain/champlain-marker.c b/champlain/champlain-marker.c index 51b4ed6..1812765 100644 --- a/champlain/champlain-marker.c +++ b/champlain/champlain-marker.c @@ -639,6 +639,8 @@ queue_redraw (ChamplainMarker *marker) static void champlain_marker_init (ChamplainMarker *marker) { + ClutterColor color = {0x33, 0x33, 0x33, 0xff}; + ClutterColor text_color = {0xee, 0xee, 0xee, 0xff}; ChamplainMarkerPrivate *priv = CHAMPLAIN_MARKER_GET_PRIVATE (marker) ; marker->priv = priv; @@ -648,10 +650,8 @@ champlain_marker_init (ChamplainMarker *marker) priv->use_markup = FALSE; priv->alignment = PANGO_ALIGN_LEFT; priv->attributes = NULL; - priv->color = g_new0 (ClutterColor, 1); - clutter_color_parse ("#333", priv->color); - priv->text_color = g_new0 (ClutterColor, 1); - clutter_color_parse ("#eee", priv->text_color); + priv->color = clutter_color_copy (&color); + priv->text_color = clutter_color_copy (&text_color); priv->font_name = g_strdup ("Sans 11"); priv->wrap = FALSE; priv->wrap_mode = PANGO_WRAP_WORD;