mirror of
https://github.com/brl/mutter.git
synced 2025-02-17 05:44:08 +00:00
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.
This commit is contained in:
parent
17539bca95
commit
5eb07a3010
@ -466,7 +466,7 @@ clutter_point_copy (const ClutterPoint *point)
|
|||||||
void
|
void
|
||||||
clutter_point_free (ClutterPoint *point)
|
clutter_point_free (ClutterPoint *point)
|
||||||
{
|
{
|
||||||
if (point != NULL)
|
if (point != NULL && point != &_clutter_point_zero)
|
||||||
g_slice_free (ClutterPoint, point);
|
g_slice_free (ClutterPoint, point);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -840,7 +840,7 @@ clutter_rect_copy (const ClutterRect *rect)
|
|||||||
void
|
void
|
||||||
clutter_rect_free (ClutterRect *rect)
|
clutter_rect_free (ClutterRect *rect)
|
||||||
{
|
{
|
||||||
if (rect != NULL)
|
if (rect != NULL && rect != &_clutter_rect_zero)
|
||||||
g_slice_free (ClutterRect, rect);
|
g_slice_free (ClutterRect, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user