From a4f0ef7f44dd1189b3b01014f34300bec30f689b Mon Sep 17 00:00:00 2001 From: Daniel Evans Date: Fri, 24 Apr 2015 15:36:46 +0100 Subject: [PATCH] Fix test crash caused by double free --- tests/test_weapon.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_weapon.cpp b/tests/test_weapon.cpp index 6b6c8a22..f24981aa 100644 --- a/tests/test_weapon.cpp +++ b/tests/test_weapon.cpp @@ -56,8 +56,8 @@ BOOST_AUTO_TEST_CASE(TestProjectile) // Grenade should have dentonated by this point BOOST_CHECK( character->mHealth < 100.f ); - Global::get().e->destroyObject(projectile); - Global::get().e->destroyObject(character); + Global::get().e->destroyObjectQueued(character); + Global::get().e->destroyQueuedObjects(); } { @@ -89,8 +89,8 @@ BOOST_AUTO_TEST_CASE(TestProjectile) BOOST_CHECK( character->mHealth < 100.f ); - Global::get().e->destroyObject(projectile); - Global::get().e->destroyObject(character); + Global::get().e->destroyObjectQueued(character); + Global::get().e->destroyQueuedObjects(); } { auto character = Global::get().e->createPedestrian(1, {25.f, 0.f, 0.f}); @@ -120,8 +120,8 @@ BOOST_AUTO_TEST_CASE(TestProjectile) BOOST_CHECK( character->mHealth < 100.f ); - Global::get().e->destroyObject(projectile); - Global::get().e->destroyObject(character); + Global::get().e->destroyObjectQueued(character); + Global::get().e->destroyQueuedObjects(); } }