contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp
branchRCL_3
changeset 64 b276298d5729
parent 59 a0713522ab97
child 74 edd621764147
--- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp	Wed Apr 14 16:16:44 2010 +0300
+++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp	Tue Apr 27 16:57:49 2010 +0300
@@ -383,6 +383,7 @@
             iServer->PanicClient( aMessage, ECPServerBadRequest );
             User::Leave( KErrGeneral );
             }
+        isRegister = ETrue;
         if ( !iNotificationHandler )
             {
             iNotificationHandler = CCPNotificationHandler::NewL(
@@ -390,7 +391,6 @@
             iDataManager->AddObserverL( iNotificationHandler );
             }
         iNotificationHandler->SaveMessageL( aMessage );
-        isRegister = ETrue;
         }
     else
         {
@@ -432,7 +432,7 @@
 void CCPServerSession::UnregisterObserverL()
     {
     CP_DEBUG( _L8("CCPServerSession::UnregisterObserverL()" ) );
-    if ( isRegister )
+    if ( isRegister && iNotificationHandler )
         {
         //remove notification handler from an array of sessions in data manager
         iDataManager->RemoveObserver( iNotificationHandler );
@@ -457,10 +457,10 @@
     CP_DEBUG( _L8("CCPServerSession::GetChangeInfoData()" ) );
     if( iNotificationHandler )
         {
-        isRegister = EFalse;
         ExternalizeAndWriteToClientL( aMessage,
             iNotificationHandler->GetPointerToChangeInfoList( ) );
         iNotificationHandler->Reset( );
+        isRegister = EFalse;
         }
     }