[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sfx2/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 9 09:17:14 UTC 2021


 sfx2/source/sidebar/TabBar.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 80f5f74b661b52717ec2848b98cad3be8192b330
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jul 8 13:48:35 2021 +0100
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri Jul 9 11:16:36 2021 +0200

    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 at allotropia.de>

diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index 8164c3e34884..881ec8f78fc2 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -248,13 +248,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#


More information about the Libreoffice-commits mailing list