]> git.lyx.org Git - features.git/commitdiff
fix the 0-ref + a memory lieak with strnew
authorLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 18 Sep 2000 18:57:22 +0000 (18:57 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 18 Sep 2000 18:57:22 +0000 (18:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1026 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/mathed/math_cursor.C

index 500644e7e88859a71309149173a9ad1ef3fa7b9c..9da00fba2eb5181adac0388e42da06d67568236c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-09-18  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
+       * 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. 
index 1442d98cc85ab82a78bd752b58b14d237f21f4d1..5e2451b55e12ee1bcd1313cfb8914a86ac8b332a 100644 (file)
@@ -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<MathAccentInset*>(cursor->GetInset())->getAccentCode());
         }