summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx6
-rw-r--r--sc/UITest_chart.mk6
-rw-r--r--vcl/source/control/wizardmachine.cxx12
3 files changed, 16 insertions, 8 deletions
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
index cd6bbe0557e2..ff90a3442f17 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
@@ -167,7 +167,7 @@ void CreationWizardUnoDlg::createDialogOnDemand()
m_xParentWindow = xFrame->getContainerWindow();
}
}
- uno::Reference< XComponent > xComp( this );
+ uno::Reference< XComponent > xKeepAlive( this );
if( m_xChartModel.is() )
{
m_xDialog = std::make_shared<CreationWizard>(Application::GetFrameWeld(m_xParentWindow), m_xChartModel, m_xCC);
@@ -195,7 +195,8 @@ void SAL_CALL CreationWizardUnoDlg::startExecuteModal( const css::uno::Reference
if( m_bUnlockControllersOnExecute && m_xChartModel.is() )
m_xChartModel->unlockControllers();
- weld::DialogController::runAsync(m_xDialog, [xListener](sal_Int32 nResult){
+ CreationWizardUnoDlg* xThat = this;
+ weld::DialogController::runAsync(m_xDialog, [xListener, xThat](sal_Int32 nResult){
if( xListener.is() )
{
::css::uno::Reference< ::css::uno::XInterface > xSource;
@@ -203,6 +204,7 @@ void SAL_CALL CreationWizardUnoDlg::startExecuteModal( const css::uno::Reference
css::ui::dialogs::DialogClosedEvent aEvent( xSource, nResult );
xListener->dialogClosed( aEvent );
}
+ xThat->m_xDialog.reset();
});
}
diff --git a/sc/UITest_chart.mk b/sc/UITest_chart.mk
index 5f9b3aa9d170..3e380391924b 100644
--- a/sc/UITest_chart.mk
+++ b/sc/UITest_chart.mk
@@ -9,9 +9,9 @@
$(eval $(call gb_UITest_UITest,chart))
-#$(eval $(call gb_UITest_add_modules,chart,$(SRCDIR)/sc/qa/uitest,\
-# chart/ \
-#))
+$(eval $(call gb_UITest_add_modules,chart,$(SRCDIR)/sc/qa/uitest,\
+ chart/ \
+))
$(eval $(call gb_UITest_set_defs,chart, \
TDOC="$(SRCDIR)/sc/qa/uitest/calc_tests/data" \
diff --git a/vcl/source/control/wizardmachine.cxx b/vcl/source/control/wizardmachine.cxx
index 839c43e81842..2b3397573612 100644
--- a/vcl/source/control/wizardmachine.cxx
+++ b/vcl/source/control/wizardmachine.cxx
@@ -1153,11 +1153,17 @@ namespace vcl
{
if ( isTravelingSuspended() )
return;
- WizardTravelSuspension aTravelGuard( *this );
- if (!prepareLeaveCurrentState(WizardTypes::eFinish))
+
+ // prevent WizardTravelSuspension from using this instance
+ // after will be destructed due to onFinish and async response call
{
- return;
+ WizardTravelSuspension aTravelGuard( *this );
+ if (!prepareLeaveCurrentState(WizardTypes::eFinish))
+ {
+ return;
+ }
}
+
onFinish();
}