Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1544483
  • 博文数量: 237
  • 博客积分: 5139
  • 博客等级: 大校
  • 技术积分: 2751
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-18 14:48
文章分类

全部博文(237)

文章存档

2016年(1)

2012年(4)

2011年(120)

2010年(36)

2009年(64)

2008年(12)

分类: C/C++

2009-10-18 17:47:22

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(),所以也会出现这个问题。

阅读(1143) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~