From 465745131e799ee40fd78030bdecebb37e2c5a0d Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 22 Jan 2024 11:57:10 +0100 Subject: [PATCH] [client,sdl] fix verbose logging only call SDL_DestroyTexture if texture != NULL --- client/SDL/dialogs/sdl_widget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/SDL/dialogs/sdl_widget.cpp b/client/SDL/dialogs/sdl_widget.cpp index 593652132..c953b9656 100644 --- a/client/SDL/dialogs/sdl_widget.cpp +++ b/client/SDL/dialogs/sdl_widget.cpp @@ -162,7 +162,8 @@ SDL_Texture* SdlWidget::render_text_wrapped(SDL_Renderer* renderer, const std::s SdlWidget::~SdlWidget() { TTF_CloseFont(_font); - SDL_DestroyTexture(_image); + if (_image) + SDL_DestroyTexture(_image); } bool SdlWidget::error_ex(Uint32 res, const char* what, const char* file, size_t line,