On Mon, Oct 10, 2022 at 12:36:42PM -0400, Scott Kostyshak wrote:
> On Mon, Oct 10, 2022 at 05:24:50PM +0200, Jean-Marc Lasgouttes wrote:
> > Le 10/10/2022 à 06:29, Scott Kostyshak a écrit :
> > > I noticed the following terminal message:
> > > 
> > >    Unassigned buffer_ member in Inset::dispatch()
> > >    LyX Code: 78 name: mathnest
> > > 
> > > Unfortunately, I could not reproduce it. Does just knowing the name,
> > > "mathnest", provide a clue, or we would need a backtrace? If so, should
> > > we add an assert here?
> > 
> > It is a bit difficult to trace this. Note however that a good way to see
> > those unassigned buffer_ members is to toggle devel-mode on. Then all these
> > insets will have a red background.
> 
> I had no idea bout devel-mode. I will use it and try to come up with a
> recipe to reproduce. I've seen the terminal message before, but only
> once every few months or so, so it might take me some time.

After a long editing session and quitting LyX, I noticed the following messages:

Unassigned buffer_ member in Inset::dispatch()
LyX Code: 85 name: mathscript
Unassigned buffer_ member in Inset::dispatch()
LyX Code: 61 name: mathdelim

I didn't have devel mode on.

Would it make sense to add an assert? That will be helpful to figure out
how to reproduce. I can add it locally, but is there a reason we don't
have it added in the code? i.e., see attached patch.

Scott
>From fd1e0c04a7957bc89e6d562bd5ddfea12d83090b Mon Sep 17 00:00:00 2001
From: Scott Kostyshak <[email protected]>
Date: Fri, 13 Jan 2023 11:17:56 -0500
Subject: [PATCH] Add assert

---
 src/insets/Inset.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/insets/Inset.cpp b/src/insets/Inset.cpp
index acd8ab2cf2..88a81e3ca3 100644
--- a/src/insets/Inset.cpp
+++ b/src/insets/Inset.cpp
@@ -347,6 +347,7 @@ void Inset::dispatch(Cursor & cur, FuncRequest & cmd)
 		lyxerr << "Unassigned buffer_ member in Inset::dispatch()" << std::endl;
 		lyxerr << "LyX Code: " << lyxCode() << " name: "
 		       << insetName(lyxCode()) << std::endl;
+		LASSERT(false, /**/);
 	} else if (cur.buffer() != buffer_)
 		lyxerr << "cur.buffer() != buffer_ in Inset::dispatch()" << std::endl;
 	cur.screenUpdateFlags(Update::Force | Update::FitCursor);
-- 
2.34.1

-- 
lyx-devel mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to