diff options
author | rubidium <rubidium@openttd.org> | 2013-06-30 20:40:49 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2013-06-30 20:40:49 +0000 |
commit | f4c9ba4981eef3bf9810e4aff0bf59e2d8ddd5e0 (patch) | |
tree | aca769dd36ce1fd0e77b645bcb32a3d04be0c107 /src | |
parent | 36bd61f3033f22341c9999552ba00cf16722c6ac (diff) | |
download | openttd-f4c9ba4981eef3bf9810e4aff0bf59e2d8ddd5e0.tar.xz |
(svn r25546) -Fix: two small memory leaks
Diffstat (limited to 'src')
-rw-r--r-- | src/script/script_scanner.cpp | 1 | ||||
-rw-r--r-- | src/viewport.cpp | 3 |
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; } |