diff --git a/utils/eliottxt.cpp b/utils/eliottxt.cpp index 3ddde66..bea0f30 100644 --- a/utils/eliottxt.cpp +++ b/utils/eliottxt.cpp @@ -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; } diff --git a/utils/ncurses.cpp b/utils/ncurses.cpp index b1545cb..c22388f 100644 --- a/utils/ncurses.cpp +++ b/utils/ncurses.cpp @@ -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();