Angus Leeming wrote:

> Several new problems appear to have crept in recently.
> 
> These two fail to produce UserGuide.tex:
> 
> $ qlyxcvs --export latex UserGuide.lyx
> QPaintDevice: Must construct a QApplication before a QPaintDevice
> $ xlyxcvs --export latex UserGuide.lyx
> 
> lyx: SIGSEGV signal caught
> Sorry, you have found a bug in LyX. Please read the bug-reporting
> instructions in Help->Introduction and send us a bug report, if
> necessary. Thanks !
> Bye.
> Aborted

These two are both caused by LyX attempting to access GUI library functions
without having initialised the GUI library in the first place. Ie, in
lyx_main.C's LyX::priv_exec want_gui is false yet control is falling
through to lyx_gui::start().

void LyX::priv_exec(int & argc, char * argv[])
{
    bool const want_gui = easyParse(argc, argv);
    ...
    lyx_gui::start(batch_command, files);
}

I think that a band-aid (which should be applied anyway) is to protect the
call to lyx_gui::start: "if (want_gui) lyx_gui::start(...);"

However, the real cause of the problem is presumably the failure of the
block above to invoke exit():

    if (last_loaded) {
        bool success = false;
        if (last_loaded->dispatch(batch_command, &success)) {
            QuitLyX();
            exit(!success);
        }
    }

What's also interesting is that sometimes I get the QPaintDevice error
message and no .tex file and sometimes it just works :( valgrind doesn't
report anything suspicious.

-- 
Angus

Reply via email to