diff -r 36d60d12b4af -r 819e59dfc032 perfapps/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneric.cpp --- a/perfapps/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneric.cpp Fri Sep 17 14:22:55 2010 +0300 +++ b/perfapps/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemGeneric.cpp Mon Oct 04 10:09:02 2010 +0300 @@ -215,34 +215,41 @@ void CMemSpyViewThreadInfoItemGeneric::SetListBoxModelL() { - iMemSpySession.GetThreadInfoItems( iThreadInfoItems, iThreadId, iType ); // TODO don't ignore error! - - iModel = new (ELeave) CDesC16ArrayFlat( iThreadInfoItems.Count() + 10 ); + + RArray threadInfoItems; + iMemSpySession.GetThreadInfoItems( threadInfoItems, iThreadId, iType ); // TODO don't ignore error! + CleanupClosePushL( threadInfoItems ); - for( TInt i=0; iCaption().Length() + iThreadInfoItems[i]->Value().Length() + 30 ); + HBufC* combined = HBufC::NewLC( threadInfoItems[i]->Caption().Length() + threadInfoItems[i]->Value().Length() + 30 ); TPtr pCombined( combined->Des() ); pCombined.Zero(); pCombined.Copy( _L("\t") ); - if( iThreadInfoItems[i]->Caption() != KNullDesC ) - pCombined.Append( iThreadInfoItems[i]->Caption() ); + if( threadInfoItems[i]->Caption() != KNullDesC ) + pCombined.Append( threadInfoItems[i]->Caption() ); if( iType != EMemSpyThreadInfoItemTypeChunk ) { pCombined.Append( _L("\t\t") ); - pCombined.Append( iThreadInfoItems[i]->Value() ); + pCombined.Append( threadInfoItems[i]->Value() ); } - iModel->AppendL( pCombined ); + model->AppendL( pCombined ); - CleanupStack::PopAndDestroy(combined); + CleanupStack::PopAndDestroy( combined ); } CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox ); //listbox->Model()->SetItemTextArray( iInfoItem ); - listbox->Model()->SetItemTextArray( iModel ); + listbox->Model()->SetItemTextArray( model ); listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + CleanupStack::Pop( model ); + CleanupStack::PopAndDestroy( &threadInfoItems ); }