From be5933a1ec6dfc0c6d0211d62f330872c092d788 Mon Sep 17 00:00:00 2001 From: Stefan Koch Date: Thu, 15 Jan 2026 11:52:59 -0500 Subject: [PATCH] fixup: Remove memory leaks in the test code. --- libgnucash/engine/test/test-qofid.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libgnucash/engine/test/test-qofid.cpp b/libgnucash/engine/test/test-qofid.cpp index 9897a87eee..b9fbd4b76f 100644 --- a/libgnucash/engine/test/test-qofid.cpp +++ b/libgnucash/engine/test/test-qofid.cpp @@ -134,6 +134,10 @@ TEST(QofIDTest, collection_compare) qof_instance_set_guid(QOF_INSTANCE(book4), guid_null()); EXPECT_EQ(-1, qof_collection_compare(target, merge)); qof_instance_set_guid(QOF_INSTANCE(book4), old_guid); + + qof_collection_destroy(target); + qof_collection_destroy(merge); + qof_collection_destroy(incompat); } static void cb_visit(GncJob* job, std::vector* results_ptr) @@ -182,6 +186,8 @@ TEST(QofIDTest, collection_foreach) EXPECT_STREQ(results[1], "ggg"); EXPECT_STREQ(results[2], "qqq"); EXPECT_STREQ(results[3], "zzz"); + + qof_collection_destroy(col); } TEST(QofIDTest, collection_print_dirty) @@ -202,4 +208,5 @@ TEST(QofIDTest, collection_print_dirty) output = testing::internal::GetCapturedStdout(); EXPECT_EQ(output.find("Book collection is dirty."), size_t(0)); qof_collection_mark_clean(col); + qof_collection_destroy(col); }