USER 42

Login to reply to this topic.
Tue, 2004-11-02 09:30
Joined: 2004-09-06
Forum posts: 349
Why do you get USER 42 panics? For instance, the code below is a part of my application (I really don't know if it's enough to say what's wrong) which raises a USER 42 panic.

void CHttpEventHandler::getvCard(RHTTPTransaction& aTrans)
{
   MHTTPDataSupplier* body = aTrans.Response().Body();
   TPtrC8 dataChunk;
   TBool isLast = body->GetNextDataPart(dataChunk);
   iRespBodyFile.Write(dataChunk);
   iRespBodyFile.Close();
   delete body;
}

iRespBodyFile has been opened and there has already been some data written to it. The aTrans is a RHTTPTransaction from SDK 2.1.

Any idea why I get a USER 42 panic?

Tue, 2004-11-02 09:34
Joined: 2004-06-11
Forum posts: 404
USER 42
According the docs:
This panic is raised by a number of RHeap member functions, AllocLen(), Free(), FreeZ(), ReAlloc(), ReAllocL(), Adjust() and AdjustL() when a pointer passed to these functions does not point to a valid cell.
------------------------------------------------------------------------------
So according to my guess its probably dataChunk or the data to which dataChunk id pointing to.
Bye.
--Mayur.

Tue, 2004-11-02 11:41
Joined: 2004-09-06
Forum posts: 349
USER 42
Thanks Mayur,

I found the error. It was not dataChunk, but well the deletion of body which couldn't be made.

Joachim
  • Login to reply to this topic.