From: kwolekr Date: Fri, 12 Apr 2013 21:20:05 +0000 (-0400) Subject: Fix double free, null texture drop X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=ce901f4c4ca97dee5ab0a3a0d3e14cf7f1cf0154;p=zefram%2Fminetest%2Fminetest_engine.git Fix double free, null texture drop --- diff --git a/src/emerge.cpp b/src/emerge.cpp index 9d3f94d4..049b3cc1 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -97,9 +97,6 @@ EmergeManager::~EmergeManager() { delete mapgen[i]; } emergethread.clear(); - - for (unsigned int i = 0; i < mapgen.size(); i++) - delete mapgen[i]; mapgen.clear(); for (unsigned int i = 0; i < ores.size(); i++) diff --git a/src/tile.cpp b/src/tile.cpp index 3bfb4bb8..39f47962 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -480,7 +480,8 @@ TextureSource::~TextureSource() driver->removeTexture(t); //cleanup source image - iter->atlas_img->drop(); + if (iter->atlas_img) + iter->atlas_img->drop(); } m_atlaspointer_cache.clear();