summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-07-08 13:48:35 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-07-08 20:16:57 +0200
commitc109e1d1f5965fe03c666fee6c0bd4dd875f29c8 (patch)
tree55034bf046dbf25a3a8d955841fa4b08dd69d1d3 /sfx2
parent3fa9e73a5b07c828ac6377fc3b40d3c71d4b3a41 (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/+/118640 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/sidebar/TabBar.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index a233519f4752..b823a7c61b3d 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#