diff options
author | glx <glx@openttd.org> | 2008-05-18 12:47:08 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2008-05-18 12:47:08 +0000 |
commit | e82bab5323c61583a4ecbbc6107ba9d38eb6aa78 (patch) | |
tree | 87b22c169689809958a9ce00c78d4fbede4ad631 /src | |
parent | fc4393dcfee86962549736b429f69cc551ea1ab3 (diff) | |
download | openttd-e82bab5323c61583a4ecbbc6107ba9d38eb6aa78.tar.xz |
(svn r13161) -Fix: free the blitter list when the last blitter is removed.
Diffstat (limited to 'src')
-rw-r--r-- | src/blitter/factory.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/blitter/factory.hpp b/src/blitter/factory.hpp index e991ed8d6..bd0a6daa8 100644 --- a/src/blitter/factory.hpp +++ b/src/blitter/factory.hpp @@ -56,7 +56,13 @@ public: name(NULL) {} - virtual ~BlitterFactoryBase() { if (this->name != NULL) GetBlitters().erase(this->name); free(this->name); } + virtual ~BlitterFactoryBase() + { + if (this->name == NULL) return; + GetBlitters().erase(this->name); + if (GetBlitters().empty()) delete &GetBlitters(); + free(this->name); + } /** * Find the requested blitter and return his class. |