Join Now
Quality Rating:
  • Currently 2.0 / 5
(2.0 / 5 - 1 vote cast)
Expertise Level:
  • Currently 1.0 / 5
(1.0 / 5 - 1 vote cast)

This page was last modified 08:07, 16 November 2007.

KIS000784 - Landmarks category selector dialog leaks memory

From Forum Nokia Wiki

This known issue was originally created by Santeriv and has been verified by Forum Nokia.


ID KIS000784 Creation date November 16, 2007
Platform S60 3rd Edition
S60 3rd Edition, FP1
S60 3rd Edition, FP2
Devices  
Category Symbian C++ Subcategory Navigation, Landmarks


Description

Landmarks category selector dialog (CLmkCategorySelectorDlg) seems to leak memory whenever a category or categories are selected.


How to reproduce

 #include <clmkcategoryselectordlg.h>  // link against lmkcommonui.lib
 #include <tlmkitemiddbcombiinfo.h>
 
 CLmkCategorySelectorDlg* dlg = CLmkCategorySelectorDlg::NewL(EFalse);
 
 TLmkItemIdDbCombiInfo selectedItem;
 
 TInt ret = dlg->ExecuteLD(selectedItem); // dlg is deleted automatically
 
 if( ret != 0 )
  {
  // 'Select' or OK was pressed
  }  

The above code results in a memory leak. This is easiest to observe when running the code in the emulator because the ALLOC: <address> error is displayed when exiting the application.


Solution

After selecting a category, the TLmkItemIdDbCombiInfo object contains a pointer to the landmarks database. The client is responsible for deleting this pointer once it is no longer needed.

 ...
 TInt ret = dlg->ExecuteLD(selectedItem);
 
 if( ret != 0 )
  {
  ...       
  // store the pointer to CPosLandmarkDatabase and
  // remember to delete it in the destructor
  ilDb = selectedItem.GetLmDb();
  }  

See the LocationLandmarksUIRefApp SDK example application for a demonstration on using CLmkCategorySelectorDlg.

Related Discussions
Thread Thread Starter Forum Replies Last Post
read value from a file murmur20 General Symbian C++ 7 2004-12-10 17:51
Memory Full Problem vishaljaiswal Carbide.c++ and CodeWarrior Tools 2 2006-12-08 08:59
KErrMemory mikebukhin Python 3 2006-04-03 17:09
New project Shaikuny Symbian Tools & SDKs 2 2005-08-11 09:40
Saving on file - Unresolved Externale Symbol andreas84 General Symbian C++ 1 2003-09-29 14:43
 
Powered by MediaWiki