tests/mtk/region: Fix MtkRectangle
leak
`mtk_rectangle_new()` allocates the object dynamically, but in the "contains-point" test case the allocated object was not freed. Fix that by creating the object on the stack. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3679>
This commit is contained in:
parent
22689d722a
commit
c0ae617b3f
1 changed files with 1 additions and 1 deletions
|
@ -26,7 +26,7 @@ test_contains_point (void)
|
|||
{
|
||||
g_autoptr (MtkRegion) r1 = NULL;
|
||||
|
||||
r1 = mtk_region_create_rectangle (mtk_rectangle_new (0, 0, 100, 100));
|
||||
r1 = mtk_region_create_rectangle (&MTK_RECTANGLE_INIT (0, 0, 100, 100));
|
||||
|
||||
g_assert (!mtk_region_contains_point (r1, 200, 200));
|
||||
g_assert (mtk_region_contains_point (r1, 50, 50));
|
||||
|
|
Loading…
Reference in a new issue