Languages

Menu
Sites
Language
Resource leak prevention

Hi,

 

analysed my application with Tizen Dynamic Analyzer and I found a resource leak in my code:

 

I create File like this:

 

File file;
 
result r = file.Construct(strFilePath, "w");
 
How to prevent resource leak? 
 
PS. When I construct file with parameter "r" instead of "w" resource leak doesn't fire.
 
Thanks
Kamil
Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

4 Replies
wil smith
I couldn't observe similar behavior. If you are creating a local instance of File then it will be released automatically. Nothing to be worried about it.
Kamil N
I observed similar behavior even on example app "Dictionary". When I open file for read destructor is called: http://img211.imageshack.us/img211/4774/96382054.png But When I open file for write then destructor is not called and resource leak is fire by Tizen Dynamic Analyzer. http://img11.imageshack.us/img11/4050/13668813.png
wil smith
Hmm... strange... Better have a check on latest SDK 2.1.0
Kamil N
On 2.1 same issue