Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor vinp's Avatar
    Join Date
    Aug 2010
    Posts
    347
    Hello list,

    My assumption is that the CleanupStack exists until the program exits.
    So, would it be correct to assume that if an object is pushed on to the CleanupStack from one routine, it can be popped and destroyed in another routine, perhaps in a different file? This is assuming that the programmer is sure that what is popped and destroyed from the CleanupStack in a different routine, is the same object that was pushed on to the CleanupStack from the previous routine?

    Appreciate your comments.

    TIA
    Vin

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,664
    what you suggesting does not make too much sense, and would definetely have high chance introducing additional panics to your applciation, thus I would recommend forgetting about trying a such thing.

  3. #3
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    The programmer has to make sure that it is popping the right objects in the right order. Technically it often happens that you push something on it in one 'file' and pop in an other. For example when you are invoking NewLC of something, that NewLC method is usually somewhere else, either in an other .cpp file, or even in an other .dll.
    The rules are simple:
    - if your method is an LC method, it is expected leave something on the Cleanup Stack
    - if your method is not an LC method, it is not expected to leave anything on the Cleanup Stack

Similar Threads

  1. CleanupStack push and pops
    By lokesh_kumar_s in forum Symbian C++
    Replies: 4
    Last Post: 2010-07-11, 16:49
  2. KERN-EXEC 3 when pop-ing up item from CleanupStack
    By juannoguera in forum Symbian C++
    Replies: 4
    Last Post: 2009-06-29, 12:55
  3. CleanUpStack::Pop&Destroy(Tint)
    By arungupta_2jan in forum Symbian C++
    Replies: 2
    Last Post: 2008-04-15, 14:26
  4. Replies: 2
    Last Post: 2006-05-25, 04:36
  5. CleanupStack::Pop and CleanupStack::PopAndDestroy
    By julppoupou in forum Symbian C++
    Replies: 1
    Last Post: 2003-07-14, 06:54

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