fix memleak of SDL_Surface objects

ee35f6ac9a added a `surface& operator=(SDL_Surface* surf)` function that wrongly increased the refcounter of the passed surface so that it'd be  leaked later.

No we go back to the old behaviour where `surface& operator=(SDL_Surface* surf)` is handled by creating a temporary surface object that is calls then `surface& operator=(surface&& s)`
This commit is contained in:
gfgtdf 2020-06-08 19:27:39 +02:00 committed by GitHub
parent 8cffcb930f
commit 15c070b865
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,12 +54,6 @@ public:
return *this;
}
surface& operator=(SDL_Surface* surf)
{
assign_surface_internal(surf);
return *this;
}
surface& operator=(surface&& s) noexcept
{
free_surface();