diff -r c3690ec91ef8 -r 923ff622b8b9 src/hbservers/hbthemeserver/hbthemeserverapplication_p.h --- a/src/hbservers/hbthemeserver/hbthemeserverapplication_p.h Wed Jun 23 18:33:25 2010 +0300 +++ b/src/hbservers/hbthemeserver/hbthemeserverapplication_p.h Tue Jul 06 14:36:53 2010 +0300 @@ -47,8 +47,6 @@ bool initialize(); int exec(); - - static bool acquireLock(); static void setPriority(); public slots: @@ -74,14 +72,15 @@ Error }; Lock(); - ~Lock(){close();} + ~Lock(){ + close(); + } void close() { mFile.Close(); mFs.Close(); } State acquire(); - static bool serverExists(); private: RFs mFs; @@ -89,4 +88,18 @@ }; #endif +// Guard against starting multiple copies of the server +class HbThemeServerLocker +{ +public: + HbThemeServerLocker() {} + bool lock(); +private: + static bool serverExists(); +private: +#ifdef Q_OS_SYMBIAN + Lock mLock; +#endif +}; + #endif // HBTHEMESERVERAPPLICATION_P_H