×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    21

    Problem of Destorying CMsvEntry, thank you:D

    I am using CMsvEntry and encountering some problem.

    CMsvEntry * iMsvEntry = CMsvEntry::NewL(*iSession, KMsvGlobalOutBoxIndexEntryId, TMsvSelectionOrdering());

    CleanupStack::PushL(iMsvEntry);

    //if I put here "CleanupStack::PopAndDestroy(iMsvEntry);" nothing wrong

    iMsvEntry=iSession->GetEntryL(aId);

    CleanupStack::PopAndDestroy(iMsvEntry);//But if I put the code here an

    Access Violation occurs, could any please tell me why? And how can I destroy this object? I've been looking for solutions for a day. Thank you

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Austin, TX, USA
    Posts
    52

    Re: Problem of Destorying CMsvEntry, thank you:D

    >>Access Violation occurs, could any please tell me why?
    Before PopAndDestroy(iMvsEntry) pops and destroys, it checks to make sure iMvsEntry is the more recent pointer pushed on the cleanup stack. Since you changed the pointer with your GetEntryL(), that's not the case.

    >>And how can I destroy this object?
    Someone might say just use PopAndDestroy(), but.......

    I must point out that you probably shouldn't be pushing iMvsEntry on the cleanup stack. Do the delete in the destructor of the class whose member is iMvsEntry.

    Good luck!!
    -regan

    http://www.xenient.com
    regan_coleman AT xenient.com

  3. #3
    Super Contributor
    Join Date
    Feb 2006
    Location
    Beijing
    Posts
    4,361

    Re: Problem of Destorying CMsvEntry, thank you:D

    呵呵,看到你发了n个帖了
    有时间讨论一下:chen_xiao_tian@hotmail.com

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    21

    Re: Problem of Destorying CMsvEntry, thank you:D

    I've done with this problem, thank you so much for the help

Similar Threads

  1. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. WAP service problem on Apache
    By bigg_o in forum Browsing and Mark-ups
    Replies: 3
    Last Post: 2005-04-17, 16:05
  4. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36

Posting Permissions

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