Skip to content

Commit

Permalink
Possibly fixing Valgrind issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbi committed Feb 2, 2014
1 parent 3ac835b commit 14fcd10
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/video/texture_manager.cpp
Expand Up @@ -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;
}
}

Expand All @@ -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;
}
}
}
Expand Down

0 comments on commit 14fcd10

Please sign in to comment.