diff options
Diffstat (limited to 'src/blitter')
-rw-r--r-- | src/blitter/factory.hpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/blitter/factory.hpp b/src/blitter/factory.hpp index 928b78547..b33c9e5a9 100644 --- a/src/blitter/factory.hpp +++ b/src/blitter/factory.hpp @@ -8,7 +8,6 @@ #include "base.hpp" #include "../debug.h" #include "../string_func.h" -#include <string> #include <map> /** @@ -16,8 +15,16 @@ */ class BlitterFactoryBase { private: - char *name; - typedef std::map<std::string, BlitterFactoryBase *> Blitters; + const char *name; + + struct StringCompare { + bool operator () (const char *a, const char *b) const + { + return strcmp(a, b) < 0; + } + }; + + typedef std::map<const char *, BlitterFactoryBase *, StringCompare> Blitters; static Blitters &GetBlitters() { @@ -58,7 +65,7 @@ public: if (this->name == NULL) return; GetBlitters().erase(this->name); if (GetBlitters().empty()) delete &GetBlitters(); - free(this->name); + free((void *)this->name); } /** |