vcl/source/window/dialog.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit 73e9a9bd3d58e97de09401e1536877ae913012f9 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Nov 5 17:19:37 2019 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Nov 5 21:03:53 2019 +0100 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 <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> 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); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits