Avoid temporary object when creating new textures from disk

This commit is contained in:
Charles Dang 2017-07-17 13:13:26 +11:00
parent 2f2adc6899
commit 9add86d745

View file

@ -1411,8 +1411,7 @@ static texture create_texture_from_file(const image::locator& loc)
// TODO: if we need to use SDL_RWops we should use IMG_LoadTexture_RW here instead.
{
texture temp(IMG_LoadTexture(renderer, location.c_str()));
res = temp;
res.assign(IMG_LoadTexture(renderer, location.c_str()));
}
// TODO: decide what to do about this.