From: Pierre-Luc Beaudoin Date: Fri, 1 May 2009 02:32:40 +0000 (-0400) Subject: Allow NULL to be passed to champlain_marker_set_image X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22ae6b27fbda6472835d32bd15aa3b6878cccaa5;p=libchamplain Allow NULL to be passed to champlain_marker_set_image This is effectively clear the marker's image --- diff --git a/champlain/champlain-marker.c b/champlain/champlain-marker.c index 2a9fe5e..7e8dc6c 100644 --- a/champlain/champlain-marker.c +++ b/champlain/champlain-marker.c @@ -820,14 +820,20 @@ champlain_marker_set_image (ChamplainMarker *marker, ClutterActor *image) { g_return_if_fail (CHAMPLAIN_IS_MARKER (marker)); - g_return_if_fail (CLUTTER_IS_ACTOR (image)); ChamplainMarkerPrivate *priv = marker->priv; if (priv->image != NULL) g_object_unref (priv->image); - priv->image = g_object_ref (image); + if (image != NULL) + { + g_return_if_fail (CLUTTER_IS_ACTOR (image)); + priv->image = g_object_ref (image); + } + else + priv->image = image; + g_object_notify (G_OBJECT (marker), "image"); queue_redraw (marker); }