svtools/source/control/tabbar.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit e79bd728e66272d14881d40167dcf57ef48571eb Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Sun Sep 3 14:57:06 2023 +0200 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Sep 3 17:56:15 2023 +0200 tdf#156958: fix crash when clicking out after having selected rename layer When renaming and clicking on canvas, LO goes into GetParent()->EndEditMode first time then it calls TabBarEdit::dispose method which resets m_xEntry BUT, on the same thread, LO comes here again so return if already disposed to avoid a crash See bt here: https://bugs.documentfoundation.org/attachment.cgi?id=189316 Change-Id: Id227e8aa32ab52643ab17f714c9e3325ced94907 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156482 Reviewed-by: Julien Nabet <serval2...@yahoo.fr> Tested-by: Jenkins (cherry picked from commit 55f63a3a3c61032868d1ceaeb4b379e8ccc5b890) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156440 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index ddadf400761d..1690269ba234 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -404,6 +404,12 @@ IMPL_LINK( TabBarEdit, ImplEndEditHdl, void*, pCancel, void ) ResetPostEvent(); maLoseFocusIdle.Stop(); + // tdf#156958: when renaming and clicking on canvas, LO goes into GetParent()->EndEditMode first time + // then it calls TabBarEdit::dispose method which resets m_xEntry BUT, on the same thread, LO comes here again + // so return if already disposed to avoid a crash + if (isDisposed()) + return; + // We need this query, because the edit gets a losefocus event, // when it shows the context menu or the insert symbol dialog if (!m_xEntry->has_focus() && m_xEntry->has_child_focus())