From 146631a5c7358fc451bff65556cedef8eaea6a13 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 17 Nov 2006 15:24:26 +0000 Subject: [PATCH] Fix Mac crash on exit. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15954 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/lyx_main.C | 11 +++++++++++ src/lyx_main.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/src/lyx_main.C b/src/lyx_main.C index 20fce9319c..104376cd77 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -159,6 +159,17 @@ struct LyX::Singletons boost::scoped_ptr LyX::singleton_; +LyX::~LyX() +{ + // Static data are not treated in the same way at all on the Mac (and + // the LyX singleton has static methods). This is the reason why the + // exit command on the Mac bypasses our dispatch machinery altogether. + // On Linux and Windows we won't pass a second time through quit() + // because quitting will already be set to true. + if (!quitting) + quit(); +} + int LyX::exec(int & argc, char * argv[]) { diff --git a/src/lyx_main.h b/src/lyx_main.h index 944d2c12f0..8c0e24e1c7 100644 --- a/src/lyx_main.h +++ b/src/lyx_main.h @@ -40,6 +40,9 @@ namespace frontend { class Application; } /// initial startup class LyX : boost::noncopyable { public: + + ~LyX(); + /** * Execute LyX. The startup sequence is as follows: * -# LyX::exec() -- 2.39.2