Hi,
I am using portion of code from BtServices sample. Following line of code crashes application at application startup:
During startup AppUi creates CChatBt.Code:HBufC* textResource = StringLoader::LoadLC( R_CHAT_SERVICE_NAME );
If I add same line of code to ConstructL method of CChatBt everything works fine.
As soon as I comment code in CChatServiceAdvertiser::ConstructL() app starts.Code:void CChatBt::ConstructL() { //OK HBufC* textResource = StringLoader::LoadLC( R_CHAT_SERVICE_NAME ); CleanupStack::PopAndDestroy( textResource ); iAdvertiser = CChatServiceAdvertiser::NewL(); } void CChatServiceAdvertiser::ConstructL() { //Crashes app HBufC* textResource = StringLoader::LoadLC( R_CHAT_SERVICE_NAME ); CleanupStack::PopAndDestroy( textResource ); }
I have surounded command with TRAPD
but it does not help. App stil crashes.Code:TRAPD(err, textResource = StringLoader::LoadL( R_CHAT_SERVICE_NAME );)
My first gues was stack size. I removed string loading from
Application stil craches.Code:void CChatBt::ConstructL() { //OK //HBufC* textResource = StringLoader::LoadLC(R_CHAT_SERVICE_NAME); //CleanupStack::PopAndDestroy( textResource ); iAdvertiser = CChatServiceAdvertiser::NewL(); }
stack is 20 kb
(in mmp file)
EPOCSTACKSIZE 0x5000
Increasing stack size to 0x6000 did not help.
I have added
To constructL method of each class which is created during app startup. As soon as I add it to 6th class in chain, app craches.Code:HBufC* textResource = StringLoader::LoadLC(R_CHAT_SERVICE_NAME);
What can cose this behaviour?
Zdenko

Reply With Quote

