From c9b0bc2d823aa1acd44487274a5adc48275d31ea Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 19 Oct 2009 16:22:59 +0000 Subject: [PATCH] fixed Engine::removeObject() to destroy the OdeWorld object as well to remove it from the physics computations git-svn-id: svn://anubis/anaglym/trunk@108 99a6e188-d820-4881-8870-2d33a10e2619 --- Engine.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Engine.cc b/Engine.cc index 267a89a..9a1ed09 100644 --- a/Engine.cc +++ b/Engine.cc @@ -156,8 +156,12 @@ int Engine::addObject(WFObj * obj, bool is_static, float scale) void Engine::removeObject(int id) { - if (getObject(id) != NULL) + Object * obj = getObject(id); + if (obj != NULL) + { m_objects.erase(id); + delete obj; + } } int Engine::cloneObject(const Engine::Object * obj)