summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-05 17:19:37 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-05 21:03:53 +0100
commit73e9a9bd3d58e97de09401e1536877ae913012f9 (patch)
treecb0e0ff28f6dfb817e210ec1a3b44767a39f4fdd /vcl
parent7eb26eceb52bea93b9ccd90f18cf5ec11dcbb365 (diff)
ensure maEndDialogFn is unset after std::move
Change-Id: I9809cc082157bd18562f812155a9ed68f522a703 Reviewed-on: https://gerrit.libreoffice.org/82084 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/dialog.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 3bba7d2fc787..14ea8dae4fdc 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1109,6 +1109,12 @@ void Dialog::EndDialog( long nResult )
if ( mpDialogImpl && mpDialogImpl->maEndCtx.isSet() )
{
auto fn = std::move(mpDialogImpl->maEndCtx.maEndDialogFn);
+ // std::move leaves maEndDialogFn in a valid state with unspecified
+ // value. For the SwSyncBtnDlg case gcc and msvc left maEndDialogFn
+ // unset, but clang left maEndDialogFn at its original value, keeping
+ // an extra reference to the DialogController in its lambda giving
+ // an inconsistent lifecycle for the dialog. Force it to be unset.
+ mpDialogImpl->maEndCtx.maEndDialogFn = nullptr;
fn(nResult);
}