summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-06-30 20:40:49 +0000
committerrubidium <rubidium@openttd.org>2013-06-30 20:40:49 +0000
commitf4c9ba4981eef3bf9810e4aff0bf59e2d8ddd5e0 (patch)
treeaca769dd36ce1fd0e77b645bcb32a3d04be0c107
parent36bd61f3033f22341c9999552ba00cf16722c6ac (diff)
downloadopenttd-f4c9ba4981eef3bf9810e4aff0bf59e2d8ddd5e0.tar.xz
(svn r25546) -Fix: two small memory leaks
-rw-r--r--src/script/script_scanner.cpp1
-rw-r--r--src/viewport.cpp3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/script/script_scanner.cpp b/src/script/script_scanner.cpp
index 248b17f9a..2197a5505 100644
--- a/src/script/script_scanner.cpp
+++ b/src/script/script_scanner.cpp
@@ -76,6 +76,7 @@ ScriptScanner::~ScriptScanner()
this->Reset();
free(this->main_script);
+ free(this->tar_file);
delete this->engine;
}
diff --git a/src/viewport.cpp b/src/viewport.cpp
index d96d283db..da0474093 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -165,6 +165,9 @@ static Point MapXYZToViewport(const ViewPort *vp, int x, int y, int z)
void DeleteWindowViewport(Window *w)
{
+ if (w->viewport == NULL) return;
+
+ delete w->viewport->overlay;
free(w->viewport);
w->viewport = NULL;
}