summaryrefslogtreecommitdiff
path: root/src/blitter/factory.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/blitter/factory.hpp')
-rw-r--r--src/blitter/factory.hpp8
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.