From 13995cea1dd2b66397a83d10fa91ff95c558734b Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Mon, 17 Jul 2017 13:13:26 +1100 Subject: [PATCH] Avoid temporary object when creating new textures from disk --- src/image.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/image.cpp b/src/image.cpp index b35121d1c471..cf24ae050a31 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -1314,8 +1314,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.