eliot-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Eliot-dev] eliot/utils eliottxt.cpp ncurses.cpp


From: eliot-dev
Subject: [Eliot-dev] eliot/utils eliottxt.cpp ncurses.cpp
Date: Sun, 29 Jan 2006 12:40:49 +0000

CVSROOT:        /sources/eliot
Module name:    eliot
Branch:         
Changes by:     Olivier Teulière <address@hidden>      06/01/29 12:40:49

Modified files:
        utils          : eliottxt.cpp ncurses.cpp 

Log message:
        Release memory properly at exit, and fixed a new/free mismatch

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/eliot/utils/eliottxt.cpp.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/eliot/eliot/utils/ncurses.cpp.diff?tr1=1.21&tr2=1.22&r1=text&r2=text

Patches:
Index: eliot/utils/eliottxt.cpp
diff -u eliot/utils/eliottxt.cpp:1.14 eliot/utils/eliottxt.cpp:1.15
--- eliot/utils/eliottxt.cpp:1.14       Sun Jan 22 12:23:53 2006
+++ eliot/utils/eliottxt.cpp    Sun Jan 29 12:40:49 2006
@@ -60,7 +60,7 @@
     }
     if (wline_read)
     {
-        free(wline_read);
+        delete[] wline_read;
         wline_read = NULL;
     }
 
@@ -1005,7 +1005,7 @@
     if (line_read)
         free(line_read);
     if (wline_read)
-        free(wline_read);
+        delete[] wline_read;
 
     return 0;
 }
Index: eliot/utils/ncurses.cpp
diff -u eliot/utils/ncurses.cpp:1.21 eliot/utils/ncurses.cpp:1.22
--- eliot/utils/ncurses.cpp:1.21        Sun Jan 22 12:23:53 2006
+++ eliot/utils/ncurses.cpp     Sun Jan 29 12:40:49 2006
@@ -54,6 +54,7 @@
 CursesIntf::~CursesIntf()
 {
     GameFactory::Instance()->releaseGame(*m_game);
+    GameFactory::Destroy();
 }
 
 
@@ -835,7 +836,10 @@
 
     Game *game = GameFactory::Instance()->createFromCmdLine(argc, argv);
     if (game == NULL)
+    {
+        GameFactory::Destroy();
         return 1;
+    }
 
     game->start();
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]