diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-06-07 17:05:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-07 17:09:33 +0100 |
commit | 49fa826e25415442c6ca4b18039f2dc63fab8280 (patch) | |
tree | c2ee201a0330dae27944e87cf3deaaaa171738ca | |
parent | fc7dfd1a25e6a74bc3b6100f03335eedec0527e6 (diff) |
Related: rhbz#652604 ensure wizard is dismissed if exception thrown
-rw-r--r-- | svx/source/unodraw/recoveryui.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx index 83b0295c663b..00c89833d7f0 100644 --- a/svx/source/unodraw/recoveryui.cxx +++ b/svx/source/unodraw/recoveryui.cxx @@ -42,6 +42,8 @@ #include <vcl/svapp.hxx> +#include <boost/scoped_ptr.hpp> + //=============================================== // const @@ -312,29 +314,28 @@ void RecoveryUI::impl_doRecovery() // create all needed dialogs for this operation // and bind it to the used core service - svxdr::TabDialog4Recovery* pWizard = new svxdr::TabDialog4Recovery (m_pParentWindow); - svxdr::IExtendedTabPage* pPage1 = new svxdr::RecoveryDialog (pWizard, pCore ); + boost::scoped_ptr<svxdr::TabDialog4Recovery> xWizard(new svxdr::TabDialog4Recovery(m_pParentWindow)); + svxdr::IExtendedTabPage* pPage1 = new svxdr::RecoveryDialog(xWizard.get(), pCore ); svxdr::IExtendedTabPage* pPage2 = 0; svxdr::IExtendedTabPage* pPage3 = 0; - pWizard->addTabPage(pPage1); + xWizard->addTabPage(pPage1); if ( !bRecoveryOnly && new_crash_pending() ) { - pPage2 = new svxdr::ErrorRepWelcomeDialog(pWizard ); - pPage3 = new svxdr::ErrorRepSendDialog (pWizard ); - pWizard->addTabPage(pPage2); - pWizard->addTabPage(pPage3); + pPage2 = new svxdr::ErrorRepWelcomeDialog(xWizard.get()); + pPage3 = new svxdr::ErrorRepSendDialog(xWizard.get()); + xWizard->addTabPage(pPage2); + xWizard->addTabPage(pPage3); } // start the wizard - pWizard->Execute(); + xWizard->Execute(); impl_showAllRecoveredDocs(); delete pPage3 ; delete pPage2 ; delete pPage1 ; - delete pWizard; delete_pending_crash(); } |