svtools/source/control/tabbar.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit a853af876ff59733c60f205c0cdbc240c10f01a0 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Sun Sep 3 14:57:06 2023 +0200 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Sun Sep 3 16:11:27 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 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())