From c9e33c37e6b0b4d891e581c8801cb61436b2b146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 25 Nov 2002 10:18:06 +0000 Subject: [PATCH] fix problem with uninitialized value as reported by Michael git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5711 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_cursor.C | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 250e296690..c598d5745a 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -65,7 +65,7 @@ string theCutBuffer; MathCursor::MathCursor(InsetFormulaBase * formula, bool front) - : formula_(formula), autocorrect_(false), selection_(false) + : formula_(formula), autocorrect_(false), selection_(false), targetx_(-1) { front ? first() : last(); Anchor_ = Cursor_; @@ -1467,9 +1467,11 @@ void MathCursor::handleFont(string const & font) void releaseMathCursor(BufferView * bv) { - if (!mathcursor) - return; - mathcursor->formula()->hideInsetCursor(bv); - delete mathcursor; - mathcursor = 0; + if (mathcursor) { + InsetFormulaBase * f = mathcursor->formula(); + f->hideInsetCursor(bv); + delete mathcursor; + mathcursor = 0; + f->insetUnlock(bv); + } }