Why listbox applicaion crashes on exit?

Login to reply to this topic.
Thu, 2008-04-03 07:46
Joined: 2008-04-03
Forum posts: 2

HI,
I am beginner to symbian. i have created a simple application that allow the user to logon,

after successfull login, it display the listbox, i created login dialog using resource file

if it return OK then i my Appui class create the Listboxcontainer object. and perform

actions, but the problem is that when user click back or exit while on Listbox screen, it

crashes.Error "Program closed". the main function in Apui ConstructL is :

void CMKISAppAppUi::ConstructL()
{
BaseConstructL();

TBool okPressed = CMKISAppLoginContainer::RunDlgLD(); // call login Dialog
if (okPressed)
{
iKeyListContainer = new (ELeave) CMKISAppKeyListContainer;
iKeyListContainer->SetMopParent( this );
iKeyListContainer->ConstructL( ClientRect() );
AddToStackL( iKeyListContainer );
}
else
{
Exit();
}
}

CMKISAppAppUi::~CMKISAppAppUi()
{
if (iKeyListContainer)
{
RemoveFromStack( iKeyListContainer );
delete iKeyListContainer;
}
}
void CMKISAppAppUi::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
case EEikCmdExit:
{
Exit();

break;
}
.......
}

please help me,
any suggestion will be highly appreciated.
Thanx in advance.


Thu, 2008-04-03 07:59
Joined: 2005-11-20
Forum posts: 1143
Re: Why listbox applicaion crashes on exit?

Debug it in the emulator. Your will probably see the line that causes the crash (which is now probably not included in the code that you included in your post, I would say.)

In my opinion, learning to debug is among the first things a Symbian newbie should do.


René Brunner

  • Login to reply to this topic.