From a1c4ebf2b439cff59ce72a1a99e1911c2c4c9d15 Mon Sep 17 00:00:00 2001 From: Sander Mertens Date: Wed, 26 Jul 2023 20:38:45 -0700 Subject: [PATCH] Fix leaks in C++ tests --- test/cpp_api/src/RuleBuilder.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/cpp_api/src/RuleBuilder.cpp b/test/cpp_api/src/RuleBuilder.cpp index 16db00499..12ff7633d 100644 --- a/test/cpp_api/src/RuleBuilder.cpp +++ b/test/cpp_api/src/RuleBuilder.cpp @@ -675,6 +675,8 @@ void RuleBuilder_named_rule() { flecs::entity qe = q.entity(); test_assert(qe != 0); test_str(qe.name(), "my_query"); + + q.destruct(); } void RuleBuilder_named_scoped_rule() { @@ -696,6 +698,8 @@ void RuleBuilder_named_scoped_rule() { test_assert(qe != 0); test_str(qe.name(), "query"); test_str(qe.path(), "::my::query"); + + q.destruct(); } void RuleBuilder_is_valid() { @@ -707,6 +711,8 @@ void RuleBuilder_is_valid() { flecs::log::set_level(-4); auto q_2 = ecs.rule_builder().expr("foo").build(); test_assert(!q_2.is_valid()); + + q_1.destruct(); } void RuleBuilder_unresolved_by_name() { @@ -724,6 +730,8 @@ void RuleBuilder_unresolved_by_name() { ecs.entity("Foo"); test_true(q.iter().is_true()); + + q.destruct(); } void RuleBuilder_scope() { @@ -764,4 +772,6 @@ void RuleBuilder_scope() { }); test_int(count, 3); + + r.destruct(); }