diff options
Diffstat (limited to 'apps/openmw/engine.cpp')
-rw-r--r-- | apps/openmw/engine.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 78e368cfcc..65ea181fbd 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -428,9 +428,8 @@ void OMW::Engine::setWindowIcon() else { osg::ref_ptr<osg::Image> image = result.getImage(); - SDL_Surface* surface = SDLUtil::imageToSurface(image, true); - SDL_SetWindowIcon(mWindow, surface); - SDL_FreeSurface(surface); + auto surface = SDLUtil::imageToSurface(image, true); + SDL_SetWindowIcon(mWindow, surface.get()); } } |