}
else
{
- return VideoSystem::new_texture(image.get());
+ TexturePtr texture = VideoSystem::new_texture(image.get());
+ image.reset(NULL);
+ return 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;
}
}
}