From c67481c44046bcd8d028a0b26ff8af30c58afadf Mon Sep 17 00:00:00 2001 From: stephena Date: Tue, 12 Mar 2002 19:27:11 +0000 Subject: [PATCH] Fixed some memory leaks. Some things which were new'ed weren't being deleted. Barring any major bugs or memory leaks, this will be my last release for the next major version (Stella 1.2). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@46 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/ui/common/Snapshot.cxx | 3 ++- stella/src/ui/x11/mainX11.cxx | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/stella/src/ui/common/Snapshot.cxx b/stella/src/ui/common/Snapshot.cxx index 61916fdd1..f5ba57c74 100644 --- a/stella/src/ui/common/Snapshot.cxx +++ b/stella/src/ui/common/Snapshot.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Snapshot.cxx,v 1.1 2002-03-10 01:29:54 stephena Exp $ +// $Id: Snapshot.cxx,v 1.2 2002-03-12 19:27:11 stephena Exp $ //============================================================================ #include @@ -173,6 +173,7 @@ int Snapshot::savePNG(string filename, MediaSource& mediaSource, int multiplier) delete[] newScanline; out->close(); + delete out; return 1; } diff --git a/stella/src/ui/x11/mainX11.cxx b/stella/src/ui/x11/mainX11.cxx index 6eef830ff..9a2171c34 100644 --- a/stella/src/ui/x11/mainX11.cxx +++ b/stella/src/ui/x11/mainX11.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: mainX11.cxx,v 1.12 2002-03-10 01:29:55 stephena Exp $ +// $Id: mainX11.cxx,v 1.13 2002-03-12 19:27:11 stephena Exp $ //============================================================================ #include @@ -1491,6 +1491,11 @@ void cleanup() if(theConsole) delete theConsole; +#ifdef HAVE_PNG + if(snapshot) + delete snapshot; +#endif + if(normalCursor) XFreeCursor(theDisplay, normalCursor); if(blankCursor)