×

Discussion Board

Results 1 to 5 of 5

Thread: ELeave Doubt!

  1. #1
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    323

    Exclamation ELeave Doubt!

    Dear ALL,

    i have one doubt on new(ELeave)

    "new" is used to allocate the memory dynamically in heap
    "ELeave" is parameter for new...

    what internally ELeave do?
    why we r using ELeave?
    what is mean by ELeave?
    -- for Exception Handling only we are using ELeave?

  2. #2
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: ELeave Doubt!

    Hi Damodharan,

    In Symbian new is overloaded by new(Eleave) and "Eleave" is used to avoid memory leak.

    For example...
    CMyClass* class = new (ELeave) CMyClass;

    Here, if there is not enough memory to initiate object for the CMyClass then the above function leaves.

    This is related to two-phase construction.
    The empty construction for the class is done in first phase.
    (i.e. calling default constructor, that don't contain any statement that can leave, only object's memory is assigned here)
    In second phase (ConstructL()) memory for the class member variables have been assigned.

    So as I told earlier that if there is not enough memory for creating object then ELeave will leave in first phase and so there is no chance to move ahead for Second phase construction.

    Thanks & Regards,
    Kavit.

  3. #3
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    323

    Re: ELeave Doubt!

    thx,Kavit patel

    i have one more doubt?
    wht is meany by "E"
    ELeave - means Exception Leave?

  4. #4
    Registered User
    Join Date
    Nov 2007
    Posts
    444

    Re: ELeave Doubt!

    I tnink 'E' stands for Enumeration type, as Symbian data type uses 'E' for enum types.

    Regards,
    Kavit.

  5. #5
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    323

    Re: ELeave Doubt!

    Quote Originally Posted by Kavit Patel View Post
    I tnink 'E' stands for Enumeration type, as Symbian data type uses 'E' for enum types.

    Regards,
    Kavit.
    thanks Kavit

Similar Threads

  1. problem 'Eleave'
    By aliendu in forum Symbian
    Replies: 1
    Last Post: 2007-11-16, 12:31
  2. A doubt with a simple code
    By bernie31 in forum Symbian
    Replies: 0
    Last Post: 2005-10-24, 14:26
  3. Doubt about the working of ECOM
    By symsahoo in forum Symbian
    Replies: 0
    Last Post: 2005-10-14, 04:27
  4. Doubt in Nokia PC Connrctivity SDK 2.1 demo (Visual basic).
    By narumugai in forum General Messaging
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

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