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

gfgtdf noreply at github.com
Mon Jun 8 17:27:59 UTC 2020


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 15c070b865c31f1bad4d16f664b4e18092e00d32
      https://github.com/wesnoth/wesnoth/commit/15c070b865c31f1bad4d16f664b4e18092e00d32
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2020-06-08 (Mon, 08 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