From aa597ebc0d07fe59f6a4d923455909d74a5d6611 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Thu, 19 May 2005 09:44:20 +0000 Subject: [PATCH] Don't start the gui if it was not requested (fixes a crash) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9956 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 6 ++++++ src/lyx_main.C | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a459de5298..13b68c0ed7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2005-05-18 Georg Baum + + * lyx_main.C (priv_exec): fix logic error with help from Angus + * lyx_main.C (parse_execute): set is_gui = false and remove now + obsolete comment about a segfault + 2005-05-18 Angus Leeming * buffer.C (readFile): Quote all file names passed to lyx2lyx. diff --git a/src/lyx_main.C b/src/lyx_main.C index 73cf44c403..7edfa90ae7 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -278,7 +278,13 @@ void LyX::priv_exec(int & argc, char * argv[]) files.clear(); // the files are already loaded } - lyx_gui::start(batch_command, files); + if (want_gui) + lyx_gui::start(batch_command, files); + else { + // Something went wrong above + QuitLyX(); + exit(EXIT_FAILURE); + } } @@ -879,9 +885,7 @@ int parse_execute(string const & arg, string const &) exit(1); } batch = arg; - // Argh. Setting gui to false segfaults.. - // FIXME: when ? how ? - // is_gui = false; + is_gui = false; return 1; }