Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User rtillitt's Avatar
    Join Date
    Mar 2003
    Posts
    4
    in the series 60 doc named "Coding Conventions", it states

    "You cannot push R-class objects onto the cleanup stack, hence they must not have a destructor."

    yet, in the sample code Utilities.cpp:

    RTestTwo two(2);
    CleanupClosePushL(two);
    CleanupStack::PopAndDestroy();

    they can't both be right.

    I'm guessing doc is correct in that R classes do not have constructors/destructors, but rather should implement open/close methods. However, doc is incorrect that these R classes can't be put on cleanup stack.

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,672
    Hi

    Thay both are right. I admit that it looks a bit confusing that there is a line Pop&Detroy... Anyway as you see you are using closePushL-function to put it into the cleanup stack, which indeed means that the R-Class object is not cleaned using delete, but Close as it should.

    yucca

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved