Issue 120038 - [From Symphony] There is a memory leak in function SfxObjectShell::CreatePreviewMetaFile_Impl
Summary: [From Symphony] There is a memory leak in function SfxObjectShell::CreatePrev...
Alias: None
Product: performance
Classification: Code
Component: code (show other issues)
Version: AOO 3.4.0
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.0.0
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Blocks: 120975 121366
  Show dependency tree
Reported: 2012-06-20 05:34 UTC by ChaoHuang
Modified: 2013-02-16 09:17 UTC (History)
2 users (show)

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

for file "main/sfx2/source/doc/objcont.cxx" (518 bytes, patch)
2012-06-20 05:43 UTC, ChaoHuang review?
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description ChaoHuang 2012-06-20 05:34:13 UTC
Steps to reproduce the defect:
1) Launch Aoo3.4
2) New a odp file, save it, close it

Defect : SfxObjectShell::CreatePreviewMetaFile_Impl
Comment 1 ChaoHuang 2012-06-20 05:36:51 UTC
The object typed SvtCTLOptions will be created to detect LanguageType. But it does not be released. So it is a memory leak.
Comment 2 ChaoHuang 2012-06-20 05:43:57 UTC
Created attachment 78397 [details]
for file "main/sfx2/source/doc/objcont.cxx"
Comment 3 Armin Le Grand 2012-06-20 13:41:16 UTC
ALG: Good find, a SvtCTLOptions incarnation is holded. It points to a refcounted, single incarnation which will not be able to be freed and it's refcount will not be correct. Instead of deleting the new created instance, I opted to just use a local constant variable, e.g.:

    const SvtCTLOptions aCTLOptions;

This cannot be forgotten to be deleted, also 'const as const can' is applied.
Comitted as r1352098. Thanks for the patch!
Comment 4 ChaoHuang 2012-10-17 08:12:22 UTC
Suggest to put it into AOO 3.5.0 release
Comment 5 Yan Ji 2012-11-30 04:46:48 UTC
Since last SVT(r1400866) shows there is no memory leak, so close this defect as resolved.