From 7f79c4d8bb6b8464e3f8152bb86eedcb55683f87 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 5 Jun 2019 19:18:11 +0200 Subject: [PATCH] Minor test memory cleanup --- tests/integration/Functions.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/integration/Functions.cpp b/tests/integration/Functions.cpp index 98a44d5..37efbb4 100644 --- a/tests/integration/Functions.cpp +++ b/tests/integration/Functions.cpp @@ -44,8 +44,12 @@ TEST_CASE( "Define script function and call from extern", "[integration]" ) { script->Evaluate(); REQUIRE(script->HasFunction("add")); - script->CallFunction("add", {new IntegerEvalValue(5)}); - script->CallFunction("add", {new IntegerEvalValue(6)}); + auto toAddVal = new IntegerEvalValue(5); + script->CallFunction("add", {toAddVal}); + delete toAddVal; + toAddVal = new IntegerEvalValue(6); + script->CallFunction("add", {toAddVal}); + delete toAddVal; auto result = script->GetVariable("result"); REQUIRE(result->GetType()->GetClass() == TypeClass::Number);