[LyX/2.5.x] fixup 3b6ec13d: better fix for SIGABRT at exiting time on macOS Tahoe
Jean-Marc Lasgouttes <[email protected]>
| Newsgroups | gmane.editors.lyx.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit 8ed3745da456e8bbd45f128635ef6d252a326aa8 Author: Jean-Marc Lasgouttes <[email protected]> Date: Wed Mar 25 15:20:08 2026 +0100 fixup 3b6ec13d: better fix for SIGABRT at exiting time on macOS Tahoe Instead of a specific code for macOS Tahoe, use GuiView::closeBufferAll() instead of GuiApplication::closeAllViews(). (cherry picked from commit b5ae004aa21b9b7f9a631ef6e817dc2d310482cb) --- src/frontends/qt/GuiApplication.cpp | 20 ++++++++------------ src/frontends/qt/GuiView.h | 5 +++-- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/frontends/qt/GuiApplication.cpp b/src/frontends/qt/GuiApplication.cpp index 27afd714d6..7e54011de8 100644 --- a/src/frontends/qt/GuiApplication.cpp +++ b/src/frontends/qt/GuiApplication.cpp @@ -1810,20 +1810,16 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr) break; case LFUN_LYX_QUIT: - // Temporary and imperfect fix for SIGABRT at exiting time on macOS - // Tahoe. See - // https://www.mail-archive.com/[email protected]/msg225496.html - // FIXME: This fix should be removed once the problem is gone. -#if defined(Q_OS_MACOS) && QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 26)) - std::this_thread::sleep_for(std::chrono::seconds(2)); -#endif + if (current_view_) { + current_view_->message(from_utf8(N_("Exiting."))); + if (!current_view_->closeBufferAll()) { + current_view_->message(from_utf8(N_("Cancelled"))); + break; + } + } // quitting is triggered by the gui code // (leaving the event loop). - if (current_view_) - current_view_->message(from_utf8(N_("Exiting."))); - if (closeAllViews()) - quit(); + QApplication::quit(); break; case LFUN_SCREEN_FONT_UPDATE: { diff --git a/src/frontends/qt/GuiView.h b/src/frontends/qt/GuiView.h index 73a6f46c68..982a54a198 100644 --- a/src/frontends/qt/GuiView.h +++ b/src/frontends/qt/GuiView.h @@ -165,6 +165,9 @@ public: bool closeWorkArea(GuiWorkArea * wa); /// closes the buffer bool closeBuffer(Buffer & buf); + /// Close all document buffers. + bool closeBufferAll(); + /// void openDocuments(std::string const & filename, int origin); /// @@ -323,8 +326,6 @@ private: void openChildDocument(std::string const & filename); /// Close current document buffer. bool closeBuffer(); - /// Close all document buffers. - bool closeBufferAll(); /// TabWorkArea * addTabWorkArea(); -- lyx-cvs mailing list [email protected] https://lists.lyx.org/mailman/listinfo/lyx-cvs