Browse Source

Free now uninitialized std::map in CPlayerInterface::~CPlayerInterface.

Frank Zago 16 years ago
parent
commit
7a6f1a383a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      client/CPlayerInterface.cpp

+ 3 - 0
client/CPlayerInterface.cpp

@@ -111,8 +111,11 @@ CPlayerInterface::~CPlayerInterface()
 
 	for(std::map<int,SDL_Surface*>::iterator i=graphics->heroWins.begin(); i!= graphics->heroWins.end(); i++)
 		SDL_FreeSurface(i->second);
+	graphics->heroWins.clear();
+
 	for(std::map<int,SDL_Surface*>::iterator i=graphics->townWins.begin(); i!= graphics->townWins.end(); i++)
 		SDL_FreeSurface(i->second);
+	graphics->townWins.clear();
 }
 void CPlayerInterface::init(ICallback * CB)
 {