From 7bfd36da335aeffc99826fb85f207e21d04dbd10 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Mon, 18 Sep 2000 18:57:22 +0000 Subject: [PATCH] fix the 0-ref + a memory lieak with strnew git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1026 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 3 +++ src/mathed/math_cursor.C | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 500644e7e8..9da00fba2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2000-09-18 Lars Gullik Bjønnes + * src/mathed/math_cursor.C (MacroModeClose): don't call SetName + with strnew in arg, use correct emptystring when calling SetName. + * several files: remove all commented code with relation to HAVE_SSTREAM beeing false. We now only support stringstream and not strstream. diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 1442d98cc8..5e2451b55e 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -777,14 +777,15 @@ void MathedCursor::MacroModeClose() if (macroln > 0 && (!l || (l && IsMacro(l->token, l->id))) && !MathMacroTable::mathMTable.getMacro(macrobf)) { if (!l) { - imacro->SetName(strnew(macrobf)); + //imacro->SetName(strnew(macrobf)); + imacro->SetName(macrobf); // This guarantees that the string will be removed by destructor imacro->SetType(LM_OT_UNDEF); } else imacro->SetName(l->name); } else { Left(); - imacro->SetName(0); + imacro->SetName(""); if (cursor->GetInset()->GetType() == LM_OT_ACCENT) { setAccent(static_cast(cursor->GetInset())->getAccentCode()); } -- 2.39.2