On 07/15/2009 11:02 AM, Vincent van Ravesteijn - TNW wrote:
Is it possible that the Buffer is being *copied* somewhere in the
mouse code? Since this is checking for the same address, that would
do
it.
When it crashes the Inset::buffer_ is 0. Unfortunately, I have
not been able to find out what inset this is. Try to uncomment
the assertion and use gdb, it is funny.
Note that this only happens with math insets, not other ones,
so it is probably a real bug that was uncovered by the assertion.
If Inset::buffer_ is 0, then you'd expect an assert in Inset::buffer()
So, if we get an assert in Inset::dispatch, it comes from cur.buffer()
...
Well, the problem here is that InsetMathChar *explicitly* doesn't have
its buffer_ set. Abdel did this at r23362, with the message: "We don't
want a buffer_ member in InsetMathChar." But I don't know why we
wouldn't. In any event, if one removes the lines he added there, then
the crash goes away. I don't know if this is connected to the fix at
r23363. There isn't all that much in the threads around that time.
Anyway, I propose to commit the attached and see what happens.
rh
Index: insets/Inset.cpp
===================================================================
--- insets/Inset.cpp (revision 30606)
+++ insets/Inset.cpp (working copy)
@@ -226,7 +226,7 @@
void Inset::dispatch(Cursor & cur, FuncRequest & cmd)
{
- //LASSERT(cur.buffer() == &buffer(), return);
+ LASSERT(cur.buffer() == &buffer(), return);
cur.updateFlags(Update::Force | Update::FitCursor);
cur.dispatched();
doDispatch(cur, cmd);
Index: mathed/InsetMathChar.h
===================================================================
--- mathed/InsetMathChar.h (revision 30606)
+++ mathed/InsetMathChar.h (working copy)
@@ -22,8 +22,6 @@
///
explicit InsetMathChar(char_type c);
///
- void setBuffer(Buffer &) {}
- ///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///
void draw(PainterInfo & pi, int x, int y) const;