CleanupStack::PushL(aActiveScheduler) panics EUser CBase 66
| Wed, 2008-02-13 08:22 | |
|
Hi, The following code panics EUser CBase 66 in my exe CTrapCleanup* cleanup = CTrapCleanup::New();The panic document is very tricky to understand. Can anybody explain why my PushL panics. If I comment this line and try to call NewL of other class which contains PushL also panics. It shows that my CleanupStack is not instantiated properly or anything else... Hint: Any call to CleanupStack::PushL panics (E32User CBase 66) in my exe code. Thanks & regards Best Regards |
|






Forum posts: 586
Have you looked at the panic description from the SDK help?
Forum posts: 32
In addition to generating panic the code in the original posting is not leave safe. This is the common pattern that is being used in EXEs:
static void ThreadFunctionL()
{
CActiveScheduler* activeScheduler = new (ELeave) CActiveScheduler;
CleanupStack::PushL(activeScheduler);
CActiveScheduler::Install(activeScheduler);
// ....................................
CleanupStack::PopAndDestroy(activeScheduler);
}
TInt E32Main()
{
CTrapCleanup* cleanup = CTrapCleanup::New();
TInt result = KErrNoMemory;
if (cleanup)
{
TRAP(result, ThreadFunctionL());
delete cleanup;
}
return result;
}
Jari