]> err.no Git - libchamplain/commitdiff
Allow NULL to be passed to champlain_marker_set_image
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Fri, 1 May 2009 02:32:40 +0000 (22:32 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Fri, 1 May 2009 02:32:40 +0000 (22:32 -0400)
This is effectively clear the marker's image

champlain/champlain-marker.c

index 2a9fe5eab1951ef1b6628ab597eb9344e32efb26..7e8dc6c4d89325b71442bf13c9927aca62d5ce9d 100644 (file)
@@ -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);
 }