]> git.lyx.org Git - features.git/commitdiff
Avoid memory leak when the label is on the first row.
authorEnrico Forestieri <forenr@lyx.org>
Thu, 19 Aug 2010 08:17:36 +0000 (08:17 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 19 Aug 2010 08:17:36 +0000 (08:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35168 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathHull.cpp

index 4fd4afe992e731565537dd376db0fdc1af8c2555..c12abd1c92c77ec3e1f127477e6b0bbf93579ccd 100644 (file)
@@ -1051,8 +1051,10 @@ void InsetMathHull::mutate(HullType newtype)
                        // set first non-empty label
                        for (row_type row = 0; row < nrows(); ++row) {
                                if (label_[row]) {
-                                       label_[0] = label_[row];
-                                       label_[row] = 0;
+                                       if (row > 0) {
+                                               label_[0] = label_[row];
+                                               label_[row] = 0;
+                                       }
                                        break;
                                }
                        }