Problem with CLogViewEvent and CLogFilter cleanup

Login to reply to this topic.
Fri, 2005-02-18 16:12
Joined: 2004-09-23
Forum posts: 10
hello everybody

I have a little problem:
application crashes when destroying log objects after CLogViewEvent object is initialized (with SetFilterL).  
If SetFilterL is not called - everything is cleaned fine. If call to SetFilterL is made - application crashes when exiting.

what can be the problem?

some code here:
Code:
//declarations from header file
CLogFilter *m_pLogFilter;
CLogClient *m_pLogClient;
CLogViewEvent *m_pLogView;
CLogEvent *m_pEvent;
RFs iFs;


//some functions bodies from source file
void CCallLog::ConstructL()
{
m_pEvent = CLogEvent::NewL();

iFs.Connect();
m_pLogClient = CLogClient::NewL(iFs);
m_pLogView = CLogViewEvent::NewL(*m_pLogClient,CActive::EPriorityStandard );

m_pLogFilter = CLogFilter::NewL();
}


void CCallLog::Refresh(int _type)
{
switch(_type)
{
case CALL_LOG_TYPE_INCOMING:
m_pLogFilter->SetDirection(_L("Incoming"));
break;
case CALL_LOG_TYPE_OUTGOING:
m_pLogFilter->SetDirection(_L("Outgoing"));
break;
case CALL_LOG_TYPE_MISSED:
m_pLogFilter->SetDirection(_L("Missed"));
break;
};

m_pLogView->Cancel();

m_pLogView->SetFilterL(*m_pLogFilter, iStatus);
SetActive();
}


void CCallLog::RunL()
{
if( iStatus == KErrNone)
{
m_pEvent = (CLogEvent*)&m_pLogView->Event();
}
}


CCallLog::~CCallLog()
{
m_pLogView->Cancel();
m_pLogClient->Cancel();
CActive::Cancel();

m_pCB=0;

if(m_pEvent) {delete m_pEvent;}
m_pEvent=0;

if(m_pLogFilter) delete m_pLogFilter;
m_pLogFilter=0;

if(m_pLogView) delete m_pLogView;
m_pLogView=0;

if(m_pLogClient) {delete m_pLogClient;}
m_pLogClient=0;

iFs.Close();
}

generally everything works.. I get log events what i need.
but that crash is a pain. Maybe there are some rules - to destroy CLogViewEvent and not to destroy CLogFilter or smothing like this. I couldnt find anything on it in documentation. and everything I tried doesn't help.

Thanks
Tssp

Sat, 2005-07-16 12:27
Joined: 2005-07-07
Forum posts: 34
Re: Problem with CLogViewEvent and CLogFilter cleanup
Hi

I try to test your code but when I start CallLog and I make one missed call application never go to RUNL

with iStatus == KErrorNone. When it go in RunL status is != kErrorNone and event from CLogEvent is empty! Wath is wrong. So I cann't reproduce your error

Dilian
Mon, 2006-01-23 09:04
Joined: 2005-04-25
Forum posts: 21
Re: Problem with CLogViewEvent and CLogFilter cleanup
i think your SetDirection String is not correct.

For example it is "Missed call" and not "Missed"

  • Login to reply to this topic.