From: Tobias Markus Date: Sun, 2 Feb 2014 00:50:22 +0000 (+0100) Subject: Possibly fixing Valgrind issue X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=14fcd10cdb8f9b4bf315dc443d937d4f2de17669;p=supertux.git Possibly fixing Valgrind issue --- diff --git a/src/video/texture_manager.cpp b/src/video/texture_manager.cpp index 0c77a5add..7e07d774a 100644 --- a/src/video/texture_manager.cpp +++ b/src/video/texture_manager.cpp @@ -192,7 +192,9 @@ TextureManager::create_image_texture_raw(const std::string& filename) } else { - return VideoSystem::new_texture(image.get()); + TexturePtr texture = VideoSystem::new_texture(image.get()); + image.reset(NULL); + return texture; } } @@ -219,7 +221,9 @@ TextureManager::create_dummy_texture() else { log_warning << "Couldn't load texture '" << dummy_texture_fname << "' (now using empty one): " << err.what() << std::endl; - return VideoSystem::new_texture(image.get()); + TexturePtr texture = VideoSystem::new_texture(image.get()); + image.reset(NULL); + return texture; } } }