Skip to content

Commit

Permalink
fix memleak of SDL_Surface objects
Browse files Browse the repository at this point in the history
ee35f6a 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)`
  • Loading branch information
gfgtdf authored and Vultraz committed Jun 8, 2020
1 parent faf4099 commit c285e56
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/sdl/surface.hpp
Expand Up @@ -52,12 +52,6 @@ class surface
return *this;
}

surface& operator=(SDL_Surface* surf)
{
assign_surface_internal(surf);
return *this;
}

surface& operator=(surface&& s) NOEXCEPT
{
free_surface();
Expand Down

0 comments on commit c285e56

Please sign in to comment.