mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-27 23:11:51 +00:00
GUI2 Canvas: Don't try to destroy a null renderer
The move constructor just above sets renderer_ to null, and SDL_DestroyRenderer() may not be called on a nullptr. Fixes an assertion failure under xmonad: https://github.com/wesnoth/wesnoth/issues/3716#issuecomment-452291506
This commit is contained in:
parent
d6d0fcf570
commit
e0fe47a6e2
@ -1379,7 +1379,8 @@ canvas::canvas(canvas&& c)
|
||||
|
||||
canvas::~canvas()
|
||||
{
|
||||
SDL_DestroyRenderer(renderer_);
|
||||
if(renderer_)
|
||||
SDL_DestroyRenderer(renderer_);
|
||||
}
|
||||
|
||||
void canvas::draw(const bool force)
|
||||
|
Loading…
x
Reference in New Issue
Block a user