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 | ca27e25ab092a403bcc44ce8219c89d2dc3c4285 (patch) | |
tree | 87b22c169689809958a9ce00c78d4fbede4ad631 | |
parent | 4d5b9e38d60a4199dc36a6d275ca8e31f1b7f97c (diff) | |
download | openttd-ca27e25ab092a403bcc44ce8219c89d2dc3c4285.tar.xz |
(svn r13161) -Fix: free the blitter list when the last blitter is removed.
-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. |