×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    2

    How to release memory assign by NewL

    Hello Everyone,



    CHttpEngine* httpEngine = CHttpEngine::NewL(*this);
    httpEngine->CancelTransaction();
    httpEngine->IssueHTTPGetL(uri8);

    could any one tell me when we need to delete this httpEngine

  2. #2
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: How to release memory assign by NewL

    Probably after the usage of object httpEngine has been finished(may be at the end of function in which you are trying to utilize it). The best in my opinion would be to declare httpEngine as member variable & delete then it in the class destructor.

  3. #3
    Registered User
    Join Date
    May 2013
    Posts
    2

    Re: How to release memory assign by NewL

    Thanks a lot.

    If i delete than it will necessary to initilize with NULL. OR i need to use CleanupStack::PopAndDestroy in the end of function

  4. #4
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: How to release memory assign by NewL

    Yes calling NULL on the object after deleting it is in fact a basic C/C++ principle. CleanupStack::PopAndDestroy is used to destroy the object (works same as delete - NULL)where the object is pushed explicitly on to the cleanupstack(though that happens when NewL() for a class is called but only Push & pop takes place not destroy for obvious reasons)

Similar Threads

  1. How to Release memory
    By madhu23 in forum Mobile Java General
    Replies: 1
    Last Post: 2011-04-15, 08:33
  2. 帮帮忙 这个javac: target release 1.1 conflicts with default source release 1.5问题怎么解决
    By zql1982 in forum [Archived] Other Programming Discussion 关于其他编程技术的讨论
    Replies: 1
    Last Post: 2006-06-28, 04:15
  3. Cannot release memory after deletion of bitmap?
    By horaceng in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2005-07-06, 08:59
  4. Memory release problem with 3650
    By jai_hot in forum Mobile Java General
    Replies: 3
    Last Post: 2004-11-06, 14:25
  5. release heap memory - Pls Help
    By pohboonsiang in forum Mobile Java General
    Replies: 1
    Last Post: 2004-03-23, 06:30

Posting Permissions

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