Skip to content

Commit

Permalink
FIXED segfault when reloading characters (but now we have a memleak)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksterker committed Aug 5, 2010
1 parent 8e93b95 commit 9ccffac
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/rpg/character.cc
Expand Up @@ -186,12 +186,15 @@ character *character::get_character (const std::string & id)
bool character::load ()
{
// cleanup first
/*
std::hash_map<std::string, character*>::iterator i;
for (i = Characters.begin(); i != Characters.end(); i++)
while (!Characters.empty())
{
delete i->second;
i->second = NULL;
i = Characters.begin();
character *c = i->second;
delete c; // this removes c from Characters and invalidates i
}
*/
Characters.clear();

base::diskio file;
Expand Down

0 comments on commit 9ccffac

Please sign in to comment.