mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-18 10:26:15 +01:00
Release memory properly at exit, and fixed a new/free mismatch
This commit is contained in:
parent
bb5a17d0f1
commit
1e13d6bfad
2 changed files with 6 additions and 2 deletions
|
@ -60,7 +60,7 @@ wchar_t *rl_gets()
|
|||
}
|
||||
if (wline_read)
|
||||
{
|
||||
free(wline_read);
|
||||
delete[] wline_read;
|
||||
wline_read = NULL;
|
||||
}
|
||||
|
||||
|
@ -1005,7 +1005,7 @@ int main(int argc, char *argv[])
|
|||
if (line_read)
|
||||
free(line_read);
|
||||
if (wline_read)
|
||||
free(wline_read);
|
||||
delete[] wline_read;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ CursesIntf::CursesIntf(WINDOW *win, Game& iGame)
|
|||
CursesIntf::~CursesIntf()
|
||||
{
|
||||
GameFactory::Instance()->releaseGame(*m_game);
|
||||
GameFactory::Destroy();
|
||||
}
|
||||
|
||||
|
||||
|
@ -835,7 +836,10 @@ int main(int argc, char ** argv)
|
|||
|
||||
Game *game = GameFactory::Instance()->createFromCmdLine(argc, argv);
|
||||
if (game == NULL)
|
||||
{
|
||||
GameFactory::Destroy();
|
||||
return 1;
|
||||
}
|
||||
|
||||
game->start();
|
||||
|
||||
|
|
Loading…
Reference in a new issue