diff -r bf573002ff72 -r aba12c885d83 calendarui/organizerplugin/aiagendapluginengine/src/CalenAsyncCommands.cpp --- a/calendarui/organizerplugin/aiagendapluginengine/src/CalenAsyncCommands.cpp Mon Jun 21 15:38:59 2010 +0300 +++ b/calendarui/organizerplugin/aiagendapluginengine/src/CalenAsyncCommands.cpp Thu Jul 15 18:37:27 2010 +0300 @@ -418,8 +418,10 @@ && iInstanceArray[i]->StartTimeL().TimeLocalL() < iDay ) { - delete iInstanceArray[i]; + CCalInstance* instance = iInstanceArray[i]; iInstanceArray.Remove( i ); + delete instance; + } else { @@ -952,8 +954,9 @@ if( entry.EntryTypeL() == CCalEntry::EAppt && entry.StatusL() == CCalEntry::ECancelled ) { - delete iInstanceArray[i]; + CCalInstance* instance = iInstanceArray[i]; iInstanceArray.Remove( i ); + delete instance; } else {