javaextensions/pim/cntadapter/src.s60/cpimcontactlistadapter.cpp
changeset 87 1627c337e51e
parent 67 63b81d807542
--- a/javaextensions/pim/cntadapter/src.s60/cpimcontactlistadapter.cpp	Fri Oct 15 12:29:39 2010 +0300
+++ b/javaextensions/pim/cntadapter/src.s60/cpimcontactlistadapter.cpp	Fri Oct 29 11:49:32 2010 +0300
@@ -199,9 +199,11 @@
 CPIMContactListAdapter::GetExternalCategoryModificationsL()
 {
     JELOG2(EPim);
+    iMutex.Wait();
     CallMethodL(this, &CPIMContactListAdapter::IsDatabaseReadyL, iFuncServer);
     RPointerArray<CPIMCategoryStateChange>* retval = iCategoryChanges;
     iCategoryChanges = NULL;
+    iMutex.Signal();
     return retval;
 }
 
@@ -290,6 +292,7 @@
     iDatabase = NULL;
     delete iMinimalFieldsViewDef;
     iMinimalFieldsViewDef = NULL;
+    iMutex.Close();
 }
 
 // -----------------------------------------------------------------------------
@@ -640,6 +643,7 @@
                                 CContactItemViewDef::EIncludeFields,
                                 CContactItemViewDef::EIncludeHiddenFields);
     InitializeMinimalViewDefinitionL();
+    User::LeaveIfError(iMutex.CreateLocal());
 }
 
 // -----------------------------------------------------------------------------
@@ -652,6 +656,7 @@
         TPIMExternalChangeType aType) // type of the change
 {
     JELOG2(EPim);
+    iMutex.Wait();
     iCategoryManager->FlushCache();
 
     // This should never happen
@@ -702,6 +707,7 @@
     CleanupStack::PushL(change);
     User::LeaveIfError(iCategoryChanges->Append(change));
     CleanupStack::Pop(change);
+    iMutex.Signal();
 }
 
 // -----------------------------------------------------------------------------