From 347452b9b69ef3af29c577b7751082822e900c01 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Thu, 19 Mar 2009 22:27:13 -0600 Subject: Be sure to free the window icon --- src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index a04c8696..2ecde05d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -145,6 +145,8 @@ std::string updatesDir; LoginHandler loginHandler; MapLoginHandler mapLoginHandler; +SDL_Surface *icon; + /** * A structure holding the values of various options that can be passed from * the command line. @@ -387,7 +389,7 @@ void init_engine(const Options &options) SetClassLong(pInfo.window, GCL_HICON, (LONG) icon); } #else - SDL_Surface *icon = IMG_Load(PKG_DATADIR "data/icons/aethyra.png"); + icon = IMG_Load(PKG_DATADIR "data/icons/aethyra.png"); if (icon) { SDL_SetAlpha(icon, SDL_SRCALPHA, SDL_ALPHA_OPAQUE); @@ -487,6 +489,8 @@ void exit_engine() ResourceManager::deleteInstance(); delete logger; + + SDL_FreeSurface(icon); } void printHelp() -- cgit v1.2.3-70-g09d2