A stray-event panic from the Active Scheduler ( E32USER-CBASE 46 error ) is a most common problem
with an Active Objects. This is ussually caused by one ( or more ) of the following:
1. You forgot to call CActiveScheduler::Add() before starting the Active Object.
2. You dont call SetActive() after issuing an async request.
3. Passing the same iStatus to two service providers at the same time ( multiple requests outstanding on the same Active Object ).
Do not invoke DoCancel() directly - it should be private - always call Cancel(). Note that Cancel() should be always be called in the destructor of your derived class.
Other related pitfalls (triggering other panics):
1. Using your own TRequestStatus variable, instead of using the one provided by CActive.
2. Passing automatic variables when doing an asynchronous request.
Careless use of active objects can degrade the response time of UI in case of:
1. Priority of active object is higher than it is necessary
2. Method RunL() works too long
二:
1.调用异步服务后必须调用SetActive(),否则就会出现stray signal
2. 给个实例:
iExmple.Start(iStatus, aLoginRequest, iLoginResponse);
SetActive();
void ExmpleClass::RunL()
{
if(iStatus.Int() != KErrNone)
{
return;
}
SetActive();
}
unL()中并没有发起异步请求,但是却调用了SetActive(),所以也会出现这个问题。
阅读(1176) | 评论(0) | 转发(0) |