×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    30

    Cannot release memory after deletion of bitmap?

    I have the following code. However, I found that after the deletion of bitmap, memory is still not freed...anything I've done wrong?

    1. in a bitmap creation function:
    iBitmap = new (ELeave) CFbsBitmap();
    iBitmap->Create(...);

    where iBitmap is an instance of CFbsBitmap.

    2. in a callback function:
    iFileToBmp->ConvertL(*iBitmap, 0);

    where iFileToBmp is an instance of CMdaImageFileToBitmapUtility.

    3. in the deleting function:
    iBitmap->Reset();
    delete iBitmap;
    iBitmap = NULL;

    I've checked the memory used before & after step 3. and found the available memory has not changed!!
    (in fact, the program can exit without error by using the above code, but it seems that the bitmap's data is still in memory after the deleting function 3.)

    Please help...really confused about that...thx a lot!

  2. #2
    Registered User
    Join Date
    Oct 2003
    Posts
    30
    as information, I use this to check available memory:

    TMemoryInfoV1Buf info;
    UserHal::MemoryInfo(info);
    TInt freeMemory = info().iFreeRamInBytes;

    thx...

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    11
    Not much use, but I am having similar problems. I'm manipulating lots of small images that are being deleted and recreated as time goes by. Whilst logging shows that all bitmaps that are created and destroyed (in the same was as horaceng has done), eventually the scaling operations return with a KErrNoMemory (-4) error.

    But I dont use that much memory at any one time. It seems maybe the FBS Server needs to flush it's shared buffer or something.

    Whilst this isn't a solution to your problem horaceng, I'm hoping this additional post will draw more attention to it. If I find a solution, I'll put it on here.

Posting Permissions

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