aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/platform/sdl/sdl-window.cpp9
-rw-r--r--backends/platform/sdl/sdl-window.h1
2 files changed, 3 insertions, 7 deletions
diff --git a/backends/platform/sdl/sdl-window.cpp b/backends/platform/sdl/sdl-window.cpp
index 2a3877c523..6d35f77ae0 100644
--- a/backends/platform/sdl/sdl-window.cpp
+++ b/backends/platform/sdl/sdl-window.cpp
@@ -30,14 +30,13 @@
SdlWindow::SdlWindow()
#if SDL_VERSION_ATLEAST(2, 0, 0)
- : _window(nullptr), _inputGrabState(false), _windowCaption("ScummVM"), _windowIcon(nullptr)
+ : _window(nullptr), _inputGrabState(false), _windowCaption("ScummVM")
#endif
{
}
SdlWindow::~SdlWindow() {
#if SDL_VERSION_ATLEAST(2, 0, 0)
- SDL_FreeSurface(_windowIcon);
destroyWindow();
#endif
}
@@ -100,16 +99,14 @@ void SdlWindow::setupIcon() {
}
#if SDL_VERSION_ATLEAST(2, 0, 0)
- SDL_FreeSurface(_windowIcon);
- _windowIcon = sdl_surf;
if (_window) {
SDL_SetWindowIcon(_window, sdl_surf);
}
#else
SDL_WM_SetIcon(sdl_surf, NULL);
- SDL_FreeSurface(sdl_surf);
#endif
+ SDL_FreeSurface(sdl_surf);
free(icon);
}
@@ -214,7 +211,7 @@ bool SdlWindow::createWindow(int width, int height, uint32 flags) {
if (!_window) {
return false;
}
- SDL_SetWindowIcon(_window, _windowIcon);
+ setupIcon();
return true;
}
diff --git a/backends/platform/sdl/sdl-window.h b/backends/platform/sdl/sdl-window.h
index 2608ea4a8f..58b898f824 100644
--- a/backends/platform/sdl/sdl-window.h
+++ b/backends/platform/sdl/sdl-window.h
@@ -101,7 +101,6 @@ protected:
private:
bool _inputGrabState;
Common::String _windowCaption;
- SDL_Surface *_windowIcon;
#endif
};