Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 167 vs 168 for /trunk/Source Code/Core/Headers/Singleton.h

Diff revisions: vs.
  @@ -26,7 +26,7 @@
26 26 template <class T>
27 27 class Singleton{
28 28 public :
29 - inline static T& getInstance() {
29 + inline static T& getOrCreateInstance() {
30 30 if (!_instance){
31 31 _instance = new T;
32 32 }
  @@ -34,6 +34,15 @@
34 34 return *_instance;
35 35 }
36 36
37 + inline static T& getInstance() {
38 + return *_instance;
39 + }
40 +
41 + inline static void createInstance() {
42 + if (!_instance)
43 + _instance = new T;
44 + }
45 +
37 46 inline static void DestroyInstance() {
38 47 if(_instance){
39 48 delete _instance;