程序编译无问题,出现上述错误,得知是指针被重复删除,可我检查了半天,不知哪一句出的问题,求高手告知
{
TBuf<20> number(_L(""));
TBuf<128> callNameBuf;
TBuf<20> firstname(_L(""));
CAknTextQueryDialog* dialog=CAknTextQueryDialog::NewL(number);//声明登陆对话框对象
if (dialog->ExecuteLD(R_LICH_KING_CONTAINER_DATA_QUERY2))
{
CPbkContactEngine* iContactsDb = CPbkContactEngine::NewL();
CleanupStack::PushL(iContactsDb);
CContactIdArray* iMyIdArray = iContactsDb->MatchPhoneNumberL(number, 15);
CleanupStack::PushL(iMyIdArray);
callNameBuf.AppendNum(iMyIdArray->Count());
CEikonEnv::InfoWinL(_L("Count of Matches"),callNameBuf);
for (TInt i = 0; i < iMyIdArray->Count(); i++)
{
TContactItemId id = (*iMyIdArray)[i];
CPbkContactItem* contact = iContactsDb->ReadContactL(id);
CleanupStack::PushL(contact);//2
CAknTextQueryDialog* dialog=CAknTextQueryDialog::NewL(firstname);//声明登陆对话框对象
if (dialog->ExecuteLD(R_LICH_KING_CONTAINER_DATA_QUERY3))
{
TPbkContactItemField* field = contact->FindField(EPbkFieldIdFirstName);
CleanupStack::PushL(field);//1
field->TextStorage()->SetTextL(firstname);
iContactsDb->CommitContactL(*contact);
CleanupStack::PopAndDestroy(field);
}
CleanupStack::PopAndDestroy(contact);
}