When my application trys to exit, I get a User 42 Panic. When i try to trace and debug my codes, i found that this error is cause when i try to delete my HBufC object.
According to the SDK,
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.
What does this mean? Am i not suppose to delete the HBufC descriptor when my application exit? How should i delete it properly?
You're not deleting it twice by mistake are you? Common mistake. The trick is wherever you are deleting an object, immediately thereafter, set it to NULL.