[wesnoth-commits] [wesnoth/wesnoth] c285e5: fix memleak of SDL_Surface objects

gfgtdf noreply at github.com
Mon Jun 8 18:02:49 UTC 2020


  Branch: refs/heads/1.14
  Home:   https://github.com/wesnoth/wesnoth
  Commit: c285e56737fb7a50dbdca6a5a43fe0ffe6d71bed
      https://github.com/wesnoth/wesnoth/commit/c285e56737fb7a50dbdca6a5a43fe0ffe6d71bed
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2020-06-09 (Tue, 09 Jun 2020)

  Changed paths:
    M src/sdl/surface.hpp

  Log Message:
  -----------
  fix memleak of SDL_Surface objects

https://github.com/wesnoth/wesnoth/commit/ee35f6ac9adf7285fed9219a4801602a5955869f 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)`





More information about the Commits mailing list