Richard Heck wrote:

I don't have time to investigate these further today, so here is what I'm thinking, in case anyone else has the time.

These are the same bug, at least in the form Jurgen saw 4082. Both crashes occur in destruction of graphic insets on exit, and both occur when there has been SOME kind of copying. In the one case, the figure is explicitly copied; in the other case, the crash occurs if you exit LyX and the selection includes a graphic---in which case the graphic is being copied to the selection buffer. So my hypothesis is that when the copy is being made, it is a shallow rather than a deep copy, and as a result both objects contain a pointer to the same something or other (thing in the graphics cache?), which is then double-freed, kaboom. Something like that, anyway.

This is I guess another singleton issue. Putting a test for quitting in might be a good idea for a quick fix:

Loader::Impl::~Impl()
{
        if (!quitting)
                resetFile(FileName());
}


A better fix would be to transfer the graphics::Cache singleton to LyX::Singletons.

Abdel.

Reply via email to