Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Table.cpp
diff options
context:
space:
mode:
1 files changed, 2 insertions, 0 deletions
-rw-r--r--src/Models/Table.cpp2
diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp
index edaccf7..7e4a7ac 100644
--- a/src/Models/Table.cpp
+++ b/src/Models/Table.cpp
@@ -39,6 +39,8 @@ void Table::putCell(unsigned row, unsigned col, const char* rawValue) {
? (Cell*)new CellFormula(rawValue, &cells) : (Cell*)new CellString(rawValue);
}
+ if (cells[row][col] != nullptr)
+ delete cells[row][col];
cells[row][col] = newCell;
}