Strangerke/scummvm — pull request #1 by criezy (2013-06-30 20:03:33+00:00)
Title: Mortevielle

Fix various memory issues reported by valgrind.

The first commit fixes access to already free'ed buffers throughout the game, because those buffer when allocated and then free'ed from initialise(). Now they are free'ed at the end of run(). The first commit added the free() in the Engine destructor, but I moved those to run() in the second commit to avoid memory leaks in case run() can be called several time on the Engine.

The second commit also fixes a memory leak on the _screenSurface. The surface was created() in initialise() and never free'ed.

With those two commits, valgrind is now happy (I only played a few minutes, so there may be more issues later on in the game).