×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Aug 2003
    Posts
    128

    delete HBufC causes User 42 Panic

    Hi,

    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?

    Regards,
    zhen

  2. #2
    Registered User
    Join Date
    Sep 2003
    Location
    Mumbai,India
    Posts
    37

    Re:delete HBufC causes User 42 Panic

    Hi,

    Could you please tell us which complier/IDE are you using?
    Are you getting same error on device?

    Manish

  3. #3
    Regular Contributor
    Join Date
    Aug 2003
    Posts
    128
    Yes. I get the same error on real device. I m using SDK Series 80 Developer Platform and the IDE I am using is CodeWarrior for Symbian OS. Thanks.

  4. #4
    Regular Contributor
    Join Date
    Feb 2005
    Posts
    328
    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.

    void CMyClass::SomeFunc()
    {
    delete iHeapObject;
    iHeapObject = NULL;

    // etc
    }

    CMyClass::~CMyClass()
    {
    delete iHeapObject; // ok if this is null
    }

  5. #5
    Regular Contributor
    Join Date
    Aug 2003
    Posts
    128
    I tried setting to null before... but to no avail.. I m sure tat i did not delete it twice

    Regards,
    zhen

Posting Permissions

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