Getting kern exec 3 while creating new listbox view

Login to reply to this topic.
Mon, 2008-04-21 10:20
Joined: 2008-04-11
Forum posts: 27

Hello All,

I am creating one listbox view from another listbox view .......my construction in CreatePlayListSongsItemsL() is fine and no err or panic but when i come out of the CreatePlayListSongsItemsL() and returns to the ViewConstructL() and when ViewConstructL() return it gives panic ----kern Exec 3.....

I am not able to find any reason for this ...so plz help me............

code is blow.....

void CMyListView::ViewConstructL()
{
ViewConstructFromResourceL(R_PLAYLISTSONGSLISTBOX_LISTVIEW_UI_CONFIGURATIONS);
CreatePlayListSongsItemsL();
}//---------------kern-Exec 3---------

void CMyListView::CreatePlayListSongsItemsL()
{
RArray GetArrContent=iMp3Utility->HandleListBoxEventInUtility(EShowPlayListSongs,MyPlayListLBSongsView);
playlistsongsviewlistBox = LocateControlByUniqueHandle(ESongsListBoxListViewListCtrl);
playlistsongsviewlistBox->SetListBoxObserver(this);
MQikListBoxModel& model(playlistsongsviewlistBox->Model());

model.ModelBeginUpdateLC();
for(TInt Pos = 0; Pos {
// Create a listBoxData item, the data returned is Open().
MQikListBoxData* listBoxData = model.NewDataL(MQikListBoxModel::EDataNormal);
// Pushes the data onto the cleanup stack.
// When CleanupStack::PopAndDestroy() is called, the data will be closed.
CleanupClosePushL(*listBoxData);

// Create a text buffer that have a maxlength that can hold the
// default name and the integer value

// Adds the text that will be visible in the list box
TBuf16 itemName16(KNullDesC);
itemName16=GetArrContent[Pos].InfoName;
listBoxData->AddTextL(itemName16, EQikListBoxSlotText1);
// Removes the listBoxData from the stack and calls close on listBoxData
CleanupStack::PopAndDestroy(listBoxData);
}
GetArrContent.Reset();
GetArrContent.Close();
// Informs that the update of the list box model has ended
model.ModelEndUpdateL();
}


correct me if m worng


Mon, 2008-04-21 12:58
Joined: 2008-04-11
Forum posts: 27
Re: Getting kern exec 3 while creating new listbox view

Some body help.........


correct me if m worng

Mon, 2008-04-21 13:14
Joined: 2005-11-20
Forum posts: 1242
Re: Getting kern exec 3 while creating new listbox view

What do you mean by "ViewConstructL returning" when the crash occurs? What does the debugger give as the top frame of the call stack at the moment of the crash?


René Brunner

Mon, 2008-04-21 13:31
Joined: 2008-04-11
Forum posts: 27
Re: Getting kern exec 3 while creating new listbox view

Thanx for the reply...............i solved my problemmmmmmmmmmm.........

Thanx


correct me if m worng

Mon, 2008-04-21 13:46
Joined: 2005-11-20
Forum posts: 1242
Re: Getting kern exec 3 while creating new listbox view

Well, yes, and what *was* the problem?

Maybe a good idea to let people here profit as well from your experiences.


René Brunner

Mon, 2008-04-21 13:48
Joined: 2008-04-11
Forum posts: 27
Re: Getting kern exec 3 while creating new listbox view

but now a different problem is there.........

first time its working fine..............

but again when i am calling the same view..............

its giving me kern exec 3 in base view class only......................is there any memory leakage there..........??????????


correct me if m worng

Mon, 2008-04-21 15:03
Joined: 2005-11-20
Forum posts: 1242
Re: Getting kern exec 3 while creating new listbox view

Would you please be so kind and tell what you did change? You know, in a forum like this, it's taking *and* giving that generates the most profit for everyone.

Beside, without knowing what you changed in respect to your earlier code sample, it might be not possible to help.


René Brunner

Tue, 2008-04-22 05:22
Joined: 2008-04-11
Forum posts: 27
Re: Getting kern exec 3 while creating new listbox view

yeah rbrunner u r ryte..........

Last time i declared the listbox object as a global variable while now its the member variable...and now i am deleting it in handlelistboxeventl() and so memory leak is removed ...which i think cased the panic....

but now a different problem is there.........

first time when i switching to view its working fine..............

but again when i am calling the same view..............

its giving me kern exec 3 in main view's HandleCommandL() only......................is problem is due to memory leakage or something else.....as its working fine at first time........


correct me if m worng

Tue, 2008-04-22 06:19
Joined: 2005-11-20
Forum posts: 1242
Re: Getting kern exec 3 while creating new listbox view

There should be no need for you to care about the listbox.

The usual way would be to declare it as a member variable of the view class, create it in ViewConstructL(), add it to the array of controls of the view with AddControlLC(), giving ownership of the listbox to the view, and the forget about it, because the view will care about releasing it at the right moment.

Releasing it in HandleListBoxEventL() is almost certainly not a good idea...


René Brunner

Tue, 2008-04-22 07:40
Joined: 2008-04-11
Forum posts: 27
Re: Getting kern exec 3 while creating new listbox view

u mean to say is, the listbox object will automatically released by the view.....we need not to delete it manually???


correct me if m worng

Tue, 2008-04-22 09:28
Joined: 2005-11-20
Forum posts: 1242
Re: Getting kern exec 3 while creating new listbox view

Yes, if you add it to the view's control array with the help of the AddControlLC() call, the view will release it for you.

But you don't *have* to use AddControlLC(). You can create and release a listbox on your own, if you like.


René Brunner

Tue, 2008-04-22 10:05
Joined: 2008-04-11
Forum posts: 27
Re: Getting kern exec 3 while creating new listbox view

yes that what i am doing.............as my application need the release of listbox obj in handlelistboxeventL()......

but i am not getting why its giving kern exec 3 when i am going into the view second time....


correct me if m worng

Tue, 2008-04-22 10:14
Joined: 2005-11-20
Forum posts: 1242
Re: Getting kern exec 3 while creating new listbox view

as my application need the release of listbox obj in handlelistboxeventL()

Why that need?

No problem to let the listbox live, if you ask me. And as I said, pretty much for sure no good idea to release the listbox while program execution is in HandleListBoxEventL(), the listbox surely being rather active at that moment, inside that method...


René Brunner

  • Login to reply to this topic.