clock/clockmw/clocktimezone/src/timezoneclient.cpp
branchGCC_SURGE
changeset 54 e6894b852bc6
parent 50 579cc610882e
child 58 ef813d54df51
--- a/clock/clockmw/clocktimezone/src/timezoneclient.cpp	Tue Jun 15 15:22:54 2010 +0100
+++ b/clock/clockmw/clocktimezone/src/timezoneclient.cpp	Thu Jul 22 16:32:51 2010 +0100
@@ -31,6 +31,7 @@
 #include "timezoneclient.h"
 #include "clockcommon.h"
 #include "clockserverclt.h"
+#include "clockprivatecrkeys.h"
 
 const int KDaysInWeek(7);
 const int KZerothRule(0);
@@ -45,7 +46,7 @@
  */
 
 TimezoneClient* TimezoneClient::mTimezoneClient = 0;
-int TimezoneClient::mReferenceCount = 0;
+bool TimezoneClient::mReferenceCount = false;
 /*!
 	Call this funtion to instantiate the TimezoneClient class.
  */
@@ -53,9 +54,9 @@
 {
 	if (!mTimezoneClient) {
 		mTimezoneClient = new TimezoneClient();
+		mReferenceCount = true;
 	}
 
-	mReferenceCount++;
 	return mTimezoneClient;
 }
 
@@ -64,9 +65,7 @@
  */
 void TimezoneClient::deleteInstance()
 {
-	mReferenceCount--;
-
-	if (0 == mReferenceCount) {
+	if (mReferenceCount) {
 		delete mTimezoneClient;
 		mTimezoneClient = 0;
 	}
@@ -77,11 +76,7 @@
  */
 bool TimezoneClient::isNull()
 {
-	bool deleted = false;
-	if (0 == mReferenceCount) {
-		deleted = true;
-	}
-	return deleted;
+	return !mReferenceCount;
 }
 
 /*!