C++ (Qt)MySingle * MySingle::mInstance = 0; MySingle * MySingle::Instance( void ){ static QMutex mutex; if (!mInstance) { QMutexlocker lock(&mutex); mInstance = new MySingle; } return mInstance;}
QScopedPointer<MySingle> MySingle::m_instance(new MySingle());MySingle *MySingle::instance() { return m_instance.data();}
C++ (Qt)MySingle * MySingle::mInstance = 0;static QMutex mutex; MySingle * MySingle::Instance( void ){ if (!mInstance) { QMutexlocker lock(&mutex); mInstance = new MySingle; } return mInstance;}
MySingle * MySingle::mInstance = 0;static QMutex mutex; MySingle * MySingle::Instance( void ){ if (!mInstance) { QMutexlocker lock(&mutex); if (!mInstance) { mInstance = new MySingle; } } return mInstance;}