You Are Here:

Community: Developer Discussion Boards

#1 Old Exception Kern Exec, deleteing CObexNullObject - 2007-06-25, 17:32

Join Date: Nov 2006
Posts: 33
siddhartha84
Offline
Registered User
Dear friends,

I am trying to establish a BT Obex connection to a Obex server.

CObexHeader* targetHdr = CObexHeader::NewL();
CleanupStack::PushL( targetHdr );
targetHdr->SetByteSeqL( KBTSUTargetHeader, KBTSBPPReferencedObjectsUUID );

ipNullObject = CObexNullObject :: NewL();
ipNullObject->AddHeaderL(*targetHdr);

TObexProtocolPolicy obexProtocolPolicy;
obexProtocolPolicy.SetReceiveMtu( KMtuSizeReceiv );
obexProtocolPolicy.SetTransmitMtu( KMtuSizeTrans );

ipObexClient = CObexClient :: NewL( aProtocolInfo, obexProtocolPolicy ) ;
iState = EWaitingToConnect;
ipObexClient->Connect( *ipNullObject, iStatus ) ;
SetActive();
CleanupStack :: PopAndDestroy();

like this.

Now when my application gets closed while CObexClient :: Connect is in Progress , I get a exception in deleteing ipNullObject. I dont know why it is happening.
my destruction code is
if(ipNullObject)
{
ipNullObject->Reset();
delete ipNullObject;
ipNullObject = NULL ;
}

Please help me with some suggestions..
Thanks in advance...
Reply With Quote

#2 Old Re: Exception Kern Exec, deleteing CObexNullObject - 2007-06-25, 18:47

Join Date: May 2003
Posts: 984
Location: Vancouver, Canada
antonypr's Avatar
antonypr
Offline
Forum Nokia Champion
Have you cancel the active object before deleting ipNullObject? It could be that this object is still used by the service provider.

Antony


Antony Pranata
http://www.antonypranata.com/
http://www.s60tips.com/
Reply With Quote

#3 Old Question Re: Exception Kern Exec, deleteing CObexNullObject - 2007-06-26, 07:12

Join Date: Nov 2006
Posts: 33
siddhartha84
Offline
Registered User
Quote:
Originally Posted by antonypr
Have you cancel the active object before deleting ipNullObject? It could be that this object is still used by the service provider.

Antony
Hi,
Thanks for your reply.
I tried to destroy the active object first but that also throwing a exception causing a Kern Exec 3 panic. I checked the function call stack. It's like this
when I am trying to delete CobexClient object first and then the CObexNullObject . My activeObject class is CActiveJobChannel.

CActiveJobChannel::doCancel() // my DoCancel implementetion, here I delete //objects of CobexClient and CObexNullObject
ObexClient::~CObexClient__deallocating() // system is calling
CObex::Error(int) // system is calling
CObexTransportControllerBase::SignalTransportError() // system is calling
exactly here exception is thrown.

Please send your suggestions. If you want some clarification pls let me know.

Thank you.

Sid.
Reply With Quote

#4 Old Question Re: Exception Kern Exec, deleteing CObexNullObject - 2007-06-26, 17:24

Join Date: Nov 2006
Posts: 33
siddhartha84
Offline
Registered User
please give me some suggestions.....
Reply With Quote

#5 Old Re: Exception Kern Exec, deleteing CObexNullObject - 2007-06-26, 17:55

Join Date: May 2003
Posts: 984
Location: Vancouver, Canada
antonypr's Avatar
antonypr
Offline
Forum Nokia Champion
Do you call Disconnect() before deleting CObexClient?

Antony


Antony Pranata
http://www.antonypranata.com/
http://www.s60tips.com/
Reply With Quote

#6 Old Re: Exception Kern Exec, deleteing CObexNullObject - 2007-06-26, 21:03

Join Date: Nov 2006
Posts: 33
siddhartha84
Offline
Registered User
Quote:
Originally Posted by antonypr
Do you call Disconnect() before deleting CObexClient?

Antony
Thanks for your reply.
No I am not calling any Abort or disconnect() method. Actually when the application is closing it tries to dstroy the active object that is having CobexClient object. Now even if I call CobexClient :: Disconnect(TRequest&) from the destructor of the active object, the next statement in the destructor will try to delete the CObexClient object and control will return....

Can you tell me what are the things I should do before deleting CobexClient object when Some OBEX operations(Connect/PUT) are going on. I think some double deletion is happening but I cant trace.......

Looking for your suggestions.
Reply With Quote

#7 Old Re: Exception Kern Exec, deleteing CObexNullObject - 2007-06-27, 02:52

Join Date: May 2003
Posts: 984
Location: Vancouver, Canada
antonypr's Avatar
antonypr
Offline
Forum Nokia Champion
I am not familiar with CObexClient. I was giving suggestions based on my observation on your code about the usage of active object.

You mention in your last comment, that there is double deletion on your pointer. You can avoid double deletion by always assigning the pointer to NULL after delete it. For example:

delete p;
p = NULL;

Not sure if this helps.

Antony


Antony Pranata
http://www.antonypranata.com/
http://www.s60tips.com/
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
KERN EXEC 0 panic at second use of an RObject and not on first saurabh_gyl General Symbian C++ 2 2007-07-19 02:29
VS.Net 2003 Carbide 2.01 and epoc32.exe ValentinK Carbide.c++ IDE and plug-ins 2 2007-01-12 13:31
why kern exec 3 on CopyFile? flicker82 General Symbian C++ 2 2005-05-16 03:25
KERN EXEC 3 system Error pankajmahto General Symbian C++ 7 2004-05-24 05:03
can not successfully link any sample using .NET lobotomat Symbian Tools & SDKs 2 2002-08-20 01:29

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia