changeset 978:9f526ddc6165

Fix memory leak (from coverity scan)
author Chris Cannam
date Wed, 03 Sep 2014 13:08:32 +0100
parents 048173126e71
children c598b1d880f2
files data/model/SparseModel.h
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/data/model/SparseModel.h	Wed Sep 03 13:06:13 2014 +0100
+++ b/data/model/SparseModel.h	Wed Sep 03 13:08:32 2014 +0100
@@ -363,9 +363,9 @@
             
     virtual Command *getRemoveRowCommand(int row)
     {
-        EditCommand *command = new EditCommand(this, tr("Delete Data Point"));
         PointListIterator i = getPointListIteratorForRow(row);
         if (i == m_points.end()) return 0;
+        EditCommand *command = new EditCommand(this, tr("Delete Data Point"));
         command->deletePoint(*i);
         return command->finish();
     }