diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-07-08 13:48:35 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-07-11 13:44:01 +0200 |
commit | 7734fb9a6fe851291a6664ed84ebf422c1c2273e (patch) | |
tree | fa65df1d40fed2e8aea38e093032d599c33f4df1 /sfx2 | |
parent | 3a8303962ea1f15d9eb4ca2b863483c6bdfb1d44 (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/+/118625
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
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 48698bb00937..20d7e0e13bb6 100644 --- a/sfx2/source/sidebar/TabBar.cxx +++ b/sfx2/source/sidebar/TabBar.cxx @@ -255,13 +255,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# |