> 2025/12/16 22:31、Koji Yokota <[email protected]>のメール:
>
> When quitting LyX with an opened file, buffer disappears unexpectedly while
> GuiApplication::dispatch(LFUN_LYX_QUIT) goes from
> UndoGroupHelper ugh(buffer); (GuiApplication.cpp:1586)
> to
> dispatch(cmd, dr);
> (GuiApplication.cpp:1587).
> Therefore, when this function tries to return d->dispatch_result_, it doesn’t
> exist.
>
> The constructor of UndoGroupHelper calls UndoGroupHelper::resetBuffer(Buffer
> * buf). When
> d->buffers_.insert(buf);
> is executed, d->buffers_ does not exist (I think it was alive in the “if”
> sentence one line before). After this line, this UndoGroupHelper class itself
> and buf disappears.
>
> In a normal quit case, d->buffers_.insert() normally finishes.
>
> I wonder what causes this problem. Is there any other processes that touches
> the buffer? Or simply buffer crashes?
In UndoGroupHelper::resetBuffer(Buffer * buf) (Undo.cpp:726),
d->buffers_.count(buf)
causes buf to become a null pointer. Before its execution, d->buffers_ exists
and contains zero entries.
Adding a call of some buf's member functions before this line works fine, so
this problem seems to relate to use of set::count().
Koji
--
lyx-devel mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-devel