Daniele Bartolini 10 år sedan
förälder
incheckning
32a61de7f9
3 ändrade filer med 5 tillägg och 5 borttagningar
  1. 1 1
      src/lua/lua_world.cpp
  2. 3 3
      src/world/world.cpp
  3. 1 1
      src/world/world.h

+ 1 - 1
src/lua/lua_world.cpp

@@ -190,7 +190,7 @@ static int world_create_debug_line(lua_State* L)
 static int world_destroy_debug_line(lua_State* L)
 {
 	LuaStack stack(L);
-	stack.get_world(1)->destroy_debug_line(stack.get_debug_line(2));
+	stack.get_world(1)->destroy_debug_line(*stack.get_debug_line(2));
 	return 0;
 }
 

+ 3 - 3
src/world/world.cpp

@@ -49,7 +49,7 @@ World::~World()
 		CE_DELETE(m_unit_pool, m_units[i]);
 	}
 
-	destroy_debug_line(_lines);
+	destroy_debug_line(*_lines);
 	SoundWorld::destroy(default_allocator(), _sound_world);
 	CE_DELETE(default_allocator(), _physics_world);
 	CE_DELETE(default_allocator(), _render_world);
@@ -233,9 +233,9 @@ DebugLine* World::create_debug_line(bool depth_test)
 	return CE_NEW(default_allocator(), DebugLine)(depth_test);
 }
 
-void World::destroy_debug_line(DebugLine* line)
+void World::destroy_debug_line(DebugLine& line)
 {
-	CE_DELETE(default_allocator(), line);
+	CE_DELETE(default_allocator(), &line);
 }
 
 void World::load_level(const LevelResource* lr)

+ 1 - 1
src/world/world.h

@@ -123,7 +123,7 @@ public:
 	DebugLine* create_debug_line(bool depth_test);
 
 	/// Destroys the debug @a line.
-	void destroy_debug_line(DebugLine* line);
+	void destroy_debug_line(DebugLine& line);
 
 	/// Loads the level @a name into the world.
 	void load_level(const LevelResource* lr);