diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-05 17:19:37 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-11-05 21:03:53 +0100 |
commit | 73e9a9bd3d58e97de09401e1536877ae913012f9 (patch) | |
tree | cb0e0ff28f6dfb817e210ec1a3b44767a39f4fdd /vcl/source | |
parent | 7eb26eceb52bea93b9ccd90f18cf5ec11dcbb365 (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/source')
-rw-r--r-- | vcl/source/window/dialog.cxx | 6 |
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); } |