Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Active object and MenuPane

3 replies · 2,958 views · Started 23 April 2003

When I�ve active object running (simple timer object) and at the same time I open the menu pane the program crashes with Kern-Exec 15. How I can handle this?

Here is some code if it�d help to solve the problem.

Starting timer...

iTimer.After(iStatus, 1000000);
SetActive();

the code in RunL -function:

iAppView->iTime++;
iAppView->DrawNow();
iTimer.After(iStatus, 1000000);
SetActive();

and when I open the menu pane the Kern-Exec 15 occurs. Do I have to cancel the active object before opening menupane? Where I can do that.
When I debug the program it looks like the program crashes in RunL -funtion in the row where I call SetActive(). Thanks for help.

look at what the documentation says:

After()
void After(TRequestStatus& aStatus,TTimeIntervalMicroSeconds32 anInterval);
Description
Requests an event after the specified interval.

The counter for this type of request stops during power-down. A 5 second timer will complete late if, for example, the machine is turned off 2 seconds after the request is made.

If this function is called while a request for a timer event is still outstanding, then it raises a KERN-EXEC 15 panic.

--------------
so it looks like you have a request outstanding somewhere which you didn't service yet.

i'm assuming iTimer is a CTimer object. if that is the case, you don't have to call it with iTimer.After(iStatus, 1000000). just call iTimer.After(1000000). since the After member is part of CTimer, it will know how to automatically pick up iStatus from itself. remember to set iStatus to KRequestPending before calling After. when the 1000000 clock ticks then pass, CTimer will change iStatus and it should call User::RequestComplete to signal the active scheduler for your thread that it's done. the active scheduler then calls RunL and all should be fine.

Ok, thanks it was just that After thing. I have inherited my active object from CActive not CTimer. I wrote there RTimer member and called After as I said. But when I inherited my active object from CTimer and removed the RTimer member everything works fine now.