aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/singleton.h2
-rw-r--r--common/system.cpp7
-rw-r--r--common/system.h8
3 files changed, 3 insertions, 14 deletions
diff --git a/common/singleton.h b/common/singleton.h
index 9e6cc5438b..dcc4241f27 100644
--- a/common/singleton.h
+++ b/common/singleton.h
@@ -60,7 +60,7 @@ public:
// order might become an issue. There are various approaches
// to solve that problem, but for now this is sufficient
if (!_singleton)
- _singleton = makeInstance();
+ _singleton = T::makeInstance();
return *_singleton;
}
protected:
diff --git a/common/system.cpp b/common/system.cpp
index 4c25d132ec..9198cb564b 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -33,12 +33,7 @@
DECLARE_SINGLETON(OSystem);
-template <>
-OSystem *Common::Singleton<OSystem>::makeInstance() {
- return OSystem::createSystem();
-}
-
-OSystem *OSystem::createSystem() {
+OSystem *OSystem::makeInstance() {
// Attention: Do not call parseGraphicsMode() here, nor any other function
// which needs to access the OSystem instance, else you get stuck in an
// endless loop.
diff --git a/common/system.h b/common/system.h
index 39ff9b3d0d..2e3693c1a9 100644
--- a/common/system.h
+++ b/common/system.h
@@ -42,7 +42,7 @@
*/
class OSystem : public Common::Singleton<OSystem> {
protected:
- static OSystem *createSystem();
+ static OSystem *makeInstance();
friend class Common::Singleton<SingletonBaseType>;
public:
@@ -678,12 +678,6 @@ public:
//@}
};
-/**
- * Custom object factory for OSystem.
- */
-template <>
-OSystem *Common::Singleton<OSystem>::makeInstance();
-
/** The global OSystem instance. Inited in main(). */