| Reply | « Previous Thread | Next Thread » |
|
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... |
| siddhartha84 |
| View Public Profile |
| Find all posts by siddhartha84 |
|
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/ |
|
Quote:
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. |
| siddhartha84 |
| View Public Profile |
| Find all posts by siddhartha84 |
|
please give me some suggestions.....
|
| siddhartha84 |
| View Public Profile |
| Find all posts by siddhartha84 |
|
Do you call Disconnect() before deleting CObexClient?
Antony Antony Pranata http://www.antonypranata.com/ http://www.s60tips.com/ |
|
Quote:
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. |
| siddhartha84 |
| View Public Profile |
| Find all posts by siddhartha84 |
|
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 | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| 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 |