dbaccess/source/ui/dlg/dbwizsetup.cxx | 1 + svtools/source/dialogs/roadmapwizard.cxx | 10 ++++------ svtools/source/dialogs/wizardmachine.cxx | 14 +++++++++++--- svtools/source/dialogs/wizdlg.cxx | 9 ++++----- 4 files changed, 20 insertions(+), 14 deletions(-)
New commits: commit 36c8dd27b19ce5088b65096af5f464ec5720efaa Author: Michael Meeks <michael.me...@collabora.com> Date: Tue May 5 10:13:50 2015 +0100 tdf#91027 - cleanup dbaccess related dispose logic. Change-Id: Ice92188b097974b8e305c0180a791e25ed537054 diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 6edc3ce..bb3885c 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -270,6 +270,7 @@ ODbTypeWizDialogSetup::~ODbTypeWizDialogSetup() void ODbTypeWizDialogSetup::dispose() { delete m_pOutSet; + m_pOutSet = NULL; m_pGeneralPage.clear(); m_pMySQLIntroPage.clear(); m_pFinalPage.clear(); diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx index 83ef2f4..e6399790 100644 --- a/svtools/source/dialogs/roadmapwizard.cxx +++ b/svtools/source/dialogs/roadmapwizard.cxx @@ -33,16 +33,14 @@ namespace svt { - - namespace { - typedef ::std::set< WizardTypes::WizardState > StateSet; + typedef ::std::set< WizardTypes::WizardState > StateSet; typedef ::std::map< RoadmapWizardTypes::PathId, RoadmapWizardTypes::WizardPath - > Paths; + > Paths; typedef ::std::map< WizardTypes::WizardState, @@ -50,7 +48,7 @@ namespace svt OUString, RoadmapWizardTypes::RoadmapPageFactory > - > StateDescriptions; + > StateDescriptions; } struct RoadmapWizardImpl : public RoadmapWizardTypes @@ -155,10 +153,10 @@ namespace svt void RoadmapWizard::dispose() { delete m_pImpl; + m_pImpl = NULL; OWizardMachine::dispose(); } - void RoadmapWizard::SetRoadmapHelpId( const OString& _rId ) { m_pImpl->pRoadmap->SetHelpId( _rId ); diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx index 278df80..156159c 100644 --- a/svtools/source/dialogs/wizardmachine.cxx +++ b/svtools/source/dialogs/wizardmachine.cxx @@ -213,10 +213,18 @@ namespace svt m_pPrevPage.disposeAndClear(); m_pHelp.disposeAndClear(); - for (WizardState i=0; i<m_pImpl->nFirstUnknownPage; ++i) - GetPage(i)->disposeOnce(); + if (m_pImpl) + { + for (WizardState i = 0; i < m_pImpl->nFirstUnknownPage; ++i) + { + TabPage *pPage = GetPage(i); + if (pPage) + pPage->disposeOnce(); + } + delete m_pImpl; + m_pImpl = NULL; + } - delete m_pImpl; WizardDialog::dispose(); } diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx index 0d0acc4..74c04e7 100644 --- a/svtools/source/dialogs/wizdlg.cxx +++ b/svtools/source/dialogs/wizdlg.cxx @@ -622,15 +622,14 @@ void WizardDialog::SetPage( sal_uInt16 nLevel, TabPage* pPage ) TabPage* WizardDialog::GetPage( sal_uInt16 nLevel ) const { - sal_uInt16 nTempLevel = 0; - ImplWizPageData* pPageData = mpFirstPage; - while ( pPageData ) + sal_uInt16 nTempLevel = 0; + + for (ImplWizPageData* pPageData = mpFirstPage; pPageData; + pPageData = pPageData->mpNext) { if ( nTempLevel == nLevel ) return pPageData->mpPage; - nTempLevel++; - pPageData = pPageData->mpNext; } return NULL; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits