commit 7b5fe0321ec276e1d3680f58e883395692c6771f
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Tue Jan 16 14:14:04 2024 +0100

    Prevent crash with statistics while view is busy (#12935)
---
 src/frontends/qt/GuiView.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index c2ca367..8a97e10 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -1470,7 +1470,10 @@ void GuiView::showStats()
                d.already_in_selection_ = false;
        }
 
-       buf->updateStatistics(from, to);
+       // Don't attempt to calculate stats if
+       // the buffer is busy as this might crash (#12935)
+       if (!busy() && !bv->busy())
+               buf->updateStatistics(from, to);
 
        QStringList stats;
        if (word_count_enabled_) {
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to