I m creating a listbox control and has a container class for it.
Then i have the corresponding view class for it.
There is only one view in the application that is for the listbox.
In the AppUI class in InitializeContainersL() i m doing this:

iListBoxView = CBoxView::NewL();
AddViewL( iListBoxView );
SetDefaultViewL( *iListBoxView );

But when i am exiting the application by selecting the softkey exit,
first time selecting it the control again comes to the UI displaying the lisbox data
then again when i am selecting exit it gives a KERN-EXEC 3 panic after the closing brace of the view class destructor:

CListBoxView::~CListBoxView()
{
// [[[ begin generated region: do not modify [Generated Contents]
if(iListBox)
{
AppUi()->RemoveFromViewStack( *this, iListBox );
}
delete iListBox;
iListBox = NULL;
// ]]] end generated region [Generated Contents]

}//Panic raised after here

I am not able to figure out whats the problem?
plz help me.