[libchamplain] Fix a warning on remove_polygon when the view is still 0, 0 in size
- From: Pierre-Luc Beaudoin <plbeaudoin src gnome org>
- To: svn-commits-list gnome org
- Subject: [libchamplain] Fix a warning on remove_polygon when the view is still 0, 0 in size
- Date: Sun, 14 Jun 2009 18:15:22 -0400 (EDT)
commit 1da5449c8da8e5ab7e83557decc3899fca883a1c
Author: Pierre-Luc Beaudoin <pierre-luc pierlux com>
Date: Sun Jun 14 13:56:33 2009 -0400
Fix a warning on remove_polygon when the view is still 0,0 in size
champlain/champlain-view.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 95109bb..064ba93 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -2396,7 +2396,10 @@ champlain_view_add_polygon (ChamplainView *view,
if (view->priv->viewport_size.width == 0 ||
view->priv->viewport_size.height == 0)
+ {
+ polygon->priv->actor = NULL;
return;
+ }
polygon->priv->actor = g_object_ref (clutter_cairo_new (
view->priv->viewport_size.width,
@@ -2425,7 +2428,10 @@ champlain_view_remove_polygon (ChamplainView *view,
g_return_if_fail (CHAMPLAIN_IS_POLYGON (polygon));
view->priv->polygons = g_list_remove (view->priv->polygons, polygon);
- clutter_container_remove_actor (CLUTTER_CONTAINER (view->priv->polygon_layer),
- polygon->priv->actor);
+
+ if (polygon->priv->actor != NULL)
+ clutter_container_remove_actor (CLUTTER_CONTAINER (view->priv->polygon_layer),
+ polygon->priv->actor);
+
g_object_unref (polygon);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]