Apache OpenOffice (AOO) Bugzilla – Issue 113992
Backup ChartModel object leaks when opening chart dialog
Last modified: 2017-05-20 11:41:55 UTC
This is another obvious leak from chart module we recently identified. Below is the steps to recreate the memory leak, 1. new a sc document 2. insert a chart, it then shows the chart dialog, then click finish. After that click on any cells to switch from inplace frame mode back to normal edit view 3. close the doc The callstack which creates the leaked object is, chartmodelmi!chart::ChartModel::createClone+0000002C (z:\calc\chart2\source\model\main\chartmodel.cxx, 880) chartcontrollermi!chart::DialogModel::createBackup+000000D0 (z:\calc\chart2\source\controller\dialogs\dialogmodel.cxx, 798) chartcontrollermi!chart::DialogModel::DialogModel+00000143 (z:\calc\chart2\source\controller\dialogs\dialogmodel.cxx, 387) chartcontrollermi!chart::CreationWizard::CreationWizard+0000020C (z:\calc\chart2\source\controller\dialogs\dlg_creationwizard.cxx, 99) chartcontrollermi!chart::CreationWizardUnoDlg::createDialogOnDemand+00000256 (z:\calc\chart2\source\controller\dialogs\dlg_creationwizard_uno.cxx, 240) chartcontrollermi!chart::CreationWizardUnoDlg::getPropertyValue+0000032B (z:\calc\chart2\source\controller\dialogs\dlg_creationwizard_uno.cxx, 393) scmi!FuInsertChart::FuInsertChart+00001477 (z:\calc\sc\source\ui\drawfunc\fuins2.cxx, 752) scmi!ScTabViewShell::ExecDrawIns+000002DD (z:\calc\sc\source\ui\view\tabvwshb.cxx, 373) scmi!SfxStubScTabViewShellExecDrawIns+0000000F (z:\calc\sc\wntmsci10.pro\inc\scslots.hxx, 1258) sfxmi!SfxDispatcher::Call_Impl+000004AF (z:\lib\sfx2\source\control\dispatch.cxx, 306) sfxmi!SfxDispatcher::PostMsgHandler+000000DE (z:\lib\sfx2\source\control\dispatch.cxx, 1619) sfxmi!SfxDispatcher::LinkStubPostMsgHandler+0000000F (z:\lib\sfx2\source\control\dispatch.cxx, 1579) tlmi!Link::Call+00000022 (z:\lib\tools\inc\tools\link.hxx, 142) sfxmi!SfxHintPoster::Event+0000003A (z:\lib\sfx2\source\notify\hintpost.cxx, 93) sfxmi!SfxHintPoster::LinkStubDoEvent_Impl+00000012 (z:\lib\sfx2\source\notify\hintpost.cxx, 87) tlmi!Link::Call+00000022 (z:\lib\tools\inc\tools\link.hxx, 142) vclmi!ImplHandleUserEvent+000000AC (z:\lib\vcl\source\window\winproc.cxx, 2024) vclmi!ImplWindowFrameProc+00000635 (z:\lib\vcl\source\window\winproc.cxx, 2613) vclmi!ImplHandleUserEvent+00000042 (z:\lib\vcl\win\source\window\salframe.cxx, 4804) vclmi!SalFrameWndProc+0000081E (z:\lib\vcl\win\source\window\salframe.cxx, 6463) vclmi!SalFrameWndProcW+00000054 (z:\lib\vcl\win\source\window\salframe.cxx, 6686) USER32!InternalCallWinProc+00000028 USER32!UserCallWinProcCheckWow+00000150 USER32!DispatchMessageWorker+00000306 USER32!DispatchMessageW+0000000F vclmi!ImplDispatchMessage+00000016 (z:\lib\vcl\win\source\app\saldata.cxx, 189) vclmi!ImplSalDispatchMessage+00000037 (z:\lib\vcl\win\source\app\salinst.cxx, 71 The root cause of this leak is, DialogModel.xBackupChartDocument is created in DialogModel constructor API with api DialogModel.createBackup(). While in it's Dtor, xBackupChartDocument is not completely released because of cyclic reference inside ChartModel object. Normally before it is released, xBackupChartDocument.dispose() should be called first to break the cyclic reference, but this call is missing.
Created attachment 71192 [details] patch file fix the problem
Thanks zhangjfibm! Looking at member m_xBackupChartDocument at class DialogModel I found that it is completely unused at least on current code line (dev300m86). So I have removed the member and creation of backup together with the leak. Fixed in CWS chart49. http://hg.services.openoffice.org/cws/chart49/rev/3d0c1b423fbd
zhangjfibm, please verify in CWS chart49. Thanks!
verified, thank you.
reopen it because wrongly closed.
change state because it was wrongly closed.
Mark it as verified.