summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2016-06-29 16:21:52 +0200
committerEike Rathke <erack@redhat.com>2016-07-01 11:05:03 +0000
commitaa7f3a3434c60bec0196e763ff56c76a8c9b57ff (patch)
treeb5d438853b1344088ef6a111f30705d308cffeca /sc
parent92cdfa1cb576cfe5048c17b10208eac71445d3c2 (diff)
Step towards disposing of ScDataFormDlg properly
There were some VclPtrs hiding inside std::vector (twice), so fix that, but the destructor is still not called (getting Window::~Window inconsistency assert). With this patch however the screenshot cppunit test no longer fails Thanks noelgrandin for help Change-Id: I8b46c4608cbab2070e36ef4abec226bcd997425e Reviewed-on: https://gerrit.libreoffice.org/26772 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> (cherry picked from commit ec6956491a0c6553a9fb91f64c6ceb7cd8e8aa52) fix Window::~Window: inconsistency in top window chain leak Change-Id: I4f32b77a4b107e5315e0c2bc9b20db897135c8b0 (cherry picked from commit 937cbdb579820aa1dd0526682df1ea98a34168c5) Reviewed-on: https://gerrit.libreoffice.org/26792 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/miscdlgs/datafdlg.cxx8
-rw-r--r--sc/source/ui/view/cellsh2.cxx4
2 files changed, 9 insertions, 3 deletions
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index 64dd5de5e165..f1d8f636a18f 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -216,8 +216,14 @@ void ScDataFormDlg::dispose()
m_pBtnNext.clear();
m_pBtnClose.clear();
m_pSlider.clear();
- m_pGrid.clear();
m_pFixedText.clear();
+ for ( auto aFTIter = maFixedTexts.begin(); aFTIter != maFixedTexts.end(); ++aFTIter )
+ aFTIter->disposeAndClear();
+ for ( auto aEditIter = maEdits.begin(); aEditIter != maEdits.end(); ++aEditIter )
+ aEditIter->disposeAndClear();
+ maFixedTexts.clear();
+ maEdits.clear();
+ m_pGrid.clear();
ModalDialog::dispose();
}
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 354ae1f02c11..643e88075904 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -342,8 +342,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- AbstractScDataFormDlg* pDlg = pFact->CreateScDataFormDlg(
- pTabViewShell->GetDialogParent(), pTabViewShell);
+ std::unique_ptr<AbstractScDataFormDlg> pDlg(pFact->CreateScDataFormDlg(
+ pTabViewShell->GetDialogParent(), pTabViewShell));
OSL_ENSURE(pDlg, "Dialog create fail!");
pDlg->Execute();