I am working a SettingListBox.I need dynamicly load data into
CAknEnumeratedTextPopupSettingItem.But it always panics when the application is exit.My code as below.
/////////////////////////////////////////////////////////////////////////
CDir* iDirList;
RFs iFsSession;
User::LeaveIfError(iFsSession.Connect());
User::LeaveIfError(iFsSession.GetDir(KSoundPath,KEntryAttNormal,ESortByName,iDirList));
if(iDirList)
{
CAknSettingItem* p = SettingItemArray()->At(6);
CArrayPtr<CAknEnumeratedText>* aEnumeratedTextArray = static_cast<CAknEnumeratedTextSettingItem*>(p)->
EnumeratedTextArray();
CArrayPtr<HBufC>* PoppedUpTextArray = static_cast<CAknEnumeratedTextSettingItem*>(p)->
PoppedUpTextArray();

for (TInt i=0;i<iDirList->Count();i++)
{
TFileName filename = NULL;
filename.Append((*iDirList)[i].iName);
HBufC * buf=HBufC::NewL(256);
buf=filename.AllocL();
CAknEnumeratedText * aEnumArray=
new(ELeave)CAknEnumeratedText(i,buf);
aEnumeratedTextArray->AppendL(aEnumArray);
PoppedUpTextArray->AppendL(buf);
}
static_cast<CAknEnumeratedTextSettingItem*>(p)->
HandleTextArrayUpdateL();
}
iFsSession.Close();
delete iDirList;
///////////////////////////////////////////////////////////////////////////
I want to list files in a fold to select a file.It always panics when exit the SettingListBox.
What's worry?Has example code about the aspect?
Hope help!

zhaoguiyu