×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Feb 2007
    Posts
    15

    Red face memory leak ! SDK bug or my fault ?

    Hi all:
    I just got a problem about memory leak. I got a panic alert when exit my application with ALLOC : 0xXXXXXXXX, it shows a memory leak. At last I found out a sprintf() function caused that.
    For test, I create a new AppUi application and in AppUi::ConstructL I executed :

    char buffer[128];
    sprintf(buffer, "%4d_%2d_%2d", 2007, 2, 10);


    sprintf defined in libc\stdio.h and link against estlib.lib.
    When the application exit, the panic shows.

    I also tryed sprintf provided by standard C++ library in Visual Studio. It works well with no memory leak.
    So, I don't know why. Is there anything wrong in my code ?

    Thanks for anyone read & reply.

    Sincerely.

  2. #2
    Regular Contributor
    Join Date
    Sep 2006
    Posts
    280

    Re: memory leak ! SDK bug or my fault ?

    Try using CloseSTDLIB() in your destructor.This is what the SDK says:

    Code:
    Location: libc\sys\reent.h 
    Link against: estlib.lib 
    
    
    void CloseSTDLIB();
    
    Description
    Frees the thread-local storage acquired by the STDLIB DLL.
    
    Data allocated in the thread-local storage for 
    STDLIB's DLL (the _reent structure) is not automatically cleaned up 
    when the environment is destroyed, and must be cleaned up
     by the user of STDLIB. Call this function after the point at which 
    it is known that code in STDLIB's DLL will no longer be called and its
    thread-local storage no longer needed.

  3. #3
    Registered User
    Join Date
    Feb 2007
    Posts
    15

    Talking Re: memory leak ! SDK bug or my fault ?

    It works!! It's really thank you very much.
    Best regard..

  4. #4
    Regular Contributor
    Join Date
    Sep 2007
    Location
    Hangzhou
    Posts
    399

    Re: memory leak ! SDK bug or my fault ?

    Thanks

    I met the same problem

Similar Threads

  1. CAknRadioButtonSettingPage memory leak?
    By mtg101 in forum Symbian User Interface
    Replies: 13
    Last Post: 2007-06-11, 08:42
  2. CEikEdwin memory leak?
    By Kaali in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-09-27, 11:53
  3. Memory Leak After Leave
    By gowthamyemme in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-02-23, 19:35
  4. Replies: 0
    Last Post: 2006-02-20, 11:51

Posting Permissions

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