Getting kern exec 3 while creating new listbox view
| Mon, 2008-04-21 10:20 | |
|
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() void CMyListView::CreatePlayListSongsItemsL() model.ModelBeginUpdateLC(); // Create a text buffer that have a maxlength that can hold the correct me if m worng |
|






Forum posts: 27
Some body help.........
correct me if m worng
Forum posts: 1242
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
Forum posts: 27
Thanx for the reply...............i solved my problemmmmmmmmmmm.........
Thanx
correct me if m worng
Forum posts: 1242
Well, yes, and what *was* the problem?
Maybe a good idea to let people here profit as well from your experiences.
René Brunner
Forum posts: 27
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
Forum posts: 1242
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
Forum posts: 27
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
Forum posts: 1242
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
Forum posts: 27
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
Forum posts: 1242
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
Forum posts: 27
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
Forum posts: 1242
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