qtinternetradio/irqstatisticsreporter/src/irqstatisticsreporter.cpp
changeset 14 896e9dbc5f19
parent 3 ee64f059b8e1
--- a/qtinternetradio/irqstatisticsreporter/src/irqstatisticsreporter.cpp	Tue Jul 06 14:07:20 2010 +0300
+++ b/qtinternetradio/irqstatisticsreporter/src/irqstatisticsreporter.cpp	Wed Aug 18 09:40:26 2010 +0300
@@ -22,7 +22,7 @@
 
 QMutex IRQStatisticsReporter::mMutex;
 int IRQStatisticsReporter::mRef = 0;
-IRQStatisticsReporter *IRQStatisticsReporter::mInstatnce = NULL;
+IRQStatisticsReporter *IRQStatisticsReporter::mInstance = NULL;
 
 // ---------------------------------------------------------------------------
 // IRQStatisticsReporter::openInstance()
@@ -32,16 +32,16 @@
 IRQStatisticsReporter* IRQStatisticsReporter::openInstance()
 {
     mMutex.lock();
-    if( NULL == mInstatnce )
+    if( NULL == mInstance )
     {
-        mInstatnce = new IRQStatisticsReporter();
+        mInstance = new IRQStatisticsReporter();
     }       
-    if( mInstatnce != NULL )
+    if( mInstance != NULL )
     {
         mRef++;
     }
     mMutex.unlock();
-    return mInstatnce;
+    return mInstance;
 }
 
 // ---------------------------------------------------------------------------
@@ -51,13 +51,14 @@
 //
 void IRQStatisticsReporter::closeInstance()
 {
-    if( mInstatnce != NULL )
+    if( mInstance != NULL )
     {
         mMutex.lock();
         mRef--;
         if( 0 == mRef )
         {
-            delete mInstatnce;
+            delete mInstance;
+            mInstance = NULL;
         }        
         mMutex.unlock();
     }