From 5eb07a301060225e2e33d7d8c5a61003dda7714d Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sat, 9 Jun 2012 10:38:09 +0100 Subject: [PATCH] base-types: Don't free zero point and rect Calling clutter_point_free(clutter_point_zero()) or calling clutter_rect_free(clutter_rect_zero()) should be safe, exactly like it's safe to call those functions with a NULL argument. --- clutter/clutter-base-types.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-base-types.c b/clutter/clutter-base-types.c index ac5bc73..32ed407 100644 --- a/clutter/clutter-base-types.c +++ b/clutter/clutter-base-types.c @@ -466,7 +466,7 @@ clutter_point_copy (const ClutterPoint *point) void clutter_point_free (ClutterPoint *point) { - if (point != NULL) + if (point != NULL && point != &_clutter_point_zero) g_slice_free (ClutterPoint, point); } @@ -840,7 +840,7 @@ clutter_rect_copy (const ClutterRect *rect) void clutter_rect_free (ClutterRect *rect) { - if (rect != NULL) + if (rect != NULL && rect != &_clutter_rect_zero) g_slice_free (ClutterRect, rect); } -- 2.7.4