From: ehofman Date: Fri, 14 Oct 2005 16:21:57 +0000 (+0000) Subject: Mathias Fröhlich: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2f3e4ebf3949715f88a7679dca4ae8cc331313cd;p=simgear.git Mathias Fröhlich: I have done a valgrind run in flightgear. Just start it up and close it at the fist change I had about half an hour later. property-leak.diff: A leak in the property system which I could even notice in top. texture-leak.diff: minor one, but fixed is fixed ... --- diff --git a/simgear/props/props.cxx b/simgear/props/props.cxx index dd8cb0c0..e7dac3f4 100644 --- a/simgear/props/props.cxx +++ b/simgear/props/props.cxx @@ -2143,6 +2143,7 @@ SGPropertyNode::hash_table::bucket::~bucket () { for (int i = 0; i < _length; i++) delete _entries[i]; + delete [] _entries; } SGPropertyNode::hash_table::entry * @@ -2197,6 +2198,7 @@ SGPropertyNode::hash_table::~hash_table () { for (unsigned int i = 0; i < _data_length; i++) delete _data[i]; + delete [] _data; } SGPropertyNode * diff --git a/simgear/screen/texture.cxx b/simgear/screen/texture.cxx index 56fd9540..b3f96f04 100644 --- a/simgear/screen/texture.cxx +++ b/simgear/screen/texture.cxx @@ -538,6 +538,8 @@ SGTexture::ImageClose(SGTexture::ImageRec *image) { if (image->file) gzclose(image->file); if (file) fclose(file); delete[] image->tmp; + delete[] image->rowStart; + delete[] image->rowSize; delete image; } diff --git a/simgear/screen/texture.hxx b/simgear/screen/texture.hxx index 00265336..9f76cadb 100644 --- a/simgear/screen/texture.hxx +++ b/simgear/screen/texture.hxx @@ -42,6 +42,7 @@ protected: FILE *file; typedef struct _ImageRec { + _ImageRec(void) : tmp(0), rowStart(0), rowSize(0) {} unsigned short imagic; unsigned short type; unsigned short dim;