From c2b4bee30f99d87fb4ab5e7d19e4d3eec263bd4f Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Thu, 14 Jun 2018 23:51:22 +0200 Subject: [PATCH] Ensure to destroy the main texture on reload --- src/pixmap.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pixmap.cxx b/src/pixmap.cxx index f8fa31f..163db6e 100644 --- a/src/pixmap.cxx +++ b/src/pixmap.cxx @@ -238,6 +238,12 @@ CPixmap::BltFast ( bool CPixmap::ReloadTargetTextures () { + if (this->mainTexture) + { + SDL_DestroyTexture (this->mainTexture); + this->mainTexture = nullptr; + } + for (auto & tex : m_SDLTextureInfo) { if (!tex.second.target)