Jump to content

  • Log In with Google      Sign In   
  • Create Account


Gohliath

Member Since 19 Jul 2013
Offline Last Active Aug 02 2014 10:53 PM

Posts I've Made

In Topic: This singleton keeps crashing.

24 July 2014 - 07:46 AM

may help

http://scottbilas.com/publications/gem-singleton/

a little description of that singleton

 

that version got updated already and replaced 

Singleton( void )
{
assert(!ms_singleton);
int offset = (int)(T*)1 - (int)(Singleton *)(T*)1;
ms_singleton = (T*)((int)this + offset);
}

with 

Singleton( void )
{
assert( !ms_singleton );
ms_singleton = static_cast <T*> (this);
}

PARTNERS