diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-07-08 13:48:35 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-07-09 09:57:42 +0200 |
commit | 95315e4a0cce767500e35fc32aa7aa25ca54c308 (patch) | |
tree | ebcff8cb1c613413e6da5111ee733ba0df4b8fb9 /sfx2 | |
parent | ad980a729fa5773c12339452518aa7c4e56f1fb5 (diff) |
tdf#143146 copy functor and arg before calling function that can delete this
Change-Id: I4e29fe6fa4119b709e31156afc5c2a5d08cdc072
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118624
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/TabBar.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx index eda97378bcae..540136c447f7 100644 --- a/sfx2/source/sidebar/TabBar.cxx +++ b/sfx2/source/sidebar/TabBar.cxx @@ -251,13 +251,17 @@ TabBar::Item::~Item() mrTabBar.GetContainer()->move(mxButton.get(), nullptr); } - IMPL_LINK_NOARG(TabBar::Item, HandleClick, const OString&, void) { + // tdf#143146 copy the functor and arg before calling + // GrabFocusToDocument which may destroy this object + auto aDeckActivationFunctor = maDeckActivationFunctor; + auto sDeckId = msDeckId; + mrTabBar.GrabFocusToDocument(); try { - maDeckActivationFunctor(msDeckId); + aDeckActivationFunctor(sDeckId); } catch(const css::uno::Exception&) {} // workaround for #i123198# |