Issue 113784 - chart2: SvNumberFormatter in chartmodel leaks
Summary: chart2: SvNumberFormatter in chartmodel leaks
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: chart (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P2 Trivial (vote)
Target Milestone: ---
Assignee: zhang jianfang
QA Contact: issues@graphics
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-11 06:15 UTC by zhang jianfang
Modified: 2017-05-20 11:42 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
fix code patch file (Based on OOo3.1M11 code) (3.38 KB, patch)
2010-08-11 06:16 UTC, zhang jianfang
no flags Details | Diff
patch file fix the problem (2.44 KB, patch)
2010-08-18 13:59 UTC, zhang jianfang
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description zhang jianfang 2010-08-11 06:15:49 UTC
The memory leak problem can be easily recreated by these steps,
   1. new a sw document
   2. insert a chart object, then it switches into embedded mode
   3. close the document without saving

For this simple operation,  about 65 SvNumberformat objects leaks.

This leak is caused by the SvNumberFormatter  object leaks which is allocated in
ImplChartModel::GetNumberFormatsSupplier() method.
Comment 1 zhang jianfang 2010-08-11 06:16:41 UTC
Created attachment 71031 [details]
fix code patch file (Based on OOo3.1M11 code)
Comment 2 zhang jianfang 2010-08-11 06:17:16 UTC
Raise priority to P2.
Comment 3 IngridvdM 2010-08-18 13:00:45 UTC
@zhangjfibm, I do not see how the patch is related to the problem. Did you maybe
attach the wrong file?
Comment 4 zhang jianfang 2010-08-18 13:59:02 UTC
Sorry, attached wrong patch file.
Comment 5 zhang jianfang 2010-08-18 13:59:54 UTC
Created attachment 71167 [details]
patch file fix the problem
Comment 6 IngridvdM 2010-08-18 17:17:32 UTC
Thanks! That does the trick. And thanks for pointing to the problem!
There exists a more elegant way to fix this. If we use a std::auto_ptr instead
of a pure c++ pointer, we do not need to write code for proper initialization
and destruction.
Fixed in CWS chart49.
http://hg.services.openoffice.org/cws/chart49/rev/aa59cbc86d27
Comment 7 IngridvdM 2010-10-08 17:11:29 UTC
zhangjfibm, please verify in CWS chart49. Thanks!
Comment 8 zhang jianfang 2010-10-09 01:38:30 UTC
verified, than you.
Comment 9 zhang jianfang 2010-10-11 12:54:13 UTC
reopen it because wrongly closed.
Comment 10 zhang jianfang 2010-10-11 12:55:11 UTC
change it's status because wrongly closed.
Comment 11 zhang jianfang 2010-10-11 12:55:42 UTC
Mark it as verified.