diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2023-09-03 14:57:06 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2023-09-03 16:11:27 +0200 |
commit | a853af876ff59733c60f205c0cdbc240c10f01a0 (patch) | |
tree | fadf8e0d5333bb7dabffac239485665daa05e8a9 /svtools/source | |
parent | f9c4973ac604ae091de08484ee2f5599db90a3a3 (diff) |
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 <serval2412@yahoo.fr>
Tested-by: Jenkins
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/control/tabbar.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
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()) |