[libadwaita/wip/exalm/view-switcher-cleanups: 1/3] tests: Don't leak AdwViewStack
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/view-switcher-cleanups: 1/3] tests: Don't leak AdwViewStack
- Date: Wed, 3 Nov 2021 10:16:39 +0000 (UTC)
commit 58b7c50af5ae1c396f898047b94a13ce0b907e08
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Wed Nov 3 13:17:56 2021 +0500
tests: Don't leak AdwViewStack
tests/test-view-switcher-bar.c | 5 ++---
tests/test-view-switcher.c | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/tests/test-view-switcher-bar.c b/tests/test-view-switcher-bar.c
index 25f2e233..d5a46892 100644
--- a/tests/test-view-switcher-bar.c
+++ b/tests/test-view-switcher-bar.c
@@ -11,11 +11,9 @@ static void
test_adw_view_switcher_bar_stack (void)
{
AdwViewSwitcherBar *bar = g_object_ref_sink (ADW_VIEW_SWITCHER_BAR (adw_view_switcher_bar_new ()));
- AdwViewStack *stack;
+ AdwViewStack *stack = g_object_ref_sink (ADW_VIEW_STACK (adw_view_stack_new ()));
g_assert_nonnull (bar);
-
- stack = ADW_VIEW_STACK (adw_view_stack_new ());
g_assert_nonnull (stack);
g_assert_null (adw_view_switcher_bar_get_stack (bar));
@@ -27,6 +25,7 @@ test_adw_view_switcher_bar_stack (void)
g_assert_null (adw_view_switcher_bar_get_stack (bar));
g_assert_finalize_object (bar);
+ g_assert_finalize_object (stack);
}
diff --git a/tests/test-view-switcher.c b/tests/test-view-switcher.c
index c5936fe3..85e3c548 100644
--- a/tests/test-view-switcher.c
+++ b/tests/test-view-switcher.c
@@ -30,11 +30,9 @@ static void
test_adw_view_switcher_stack (void)
{
AdwViewSwitcher *view_switcher = g_object_ref_sink (ADW_VIEW_SWITCHER (adw_view_switcher_new ()));
- AdwViewStack *stack;
+ AdwViewStack *stack = g_object_ref_sink (ADW_VIEW_STACK (adw_view_stack_new ()));
g_assert_nonnull (view_switcher);
-
- stack = ADW_VIEW_STACK (adw_view_stack_new ());
g_assert_nonnull (stack);
g_assert_null (adw_view_switcher_get_stack (view_switcher));
@@ -46,6 +44,7 @@ test_adw_view_switcher_stack (void)
g_assert_null (adw_view_switcher_get_stack (view_switcher));
g_assert_finalize_object (view_switcher);
+ g_assert_finalize_object (stack);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]