From 9535f94e389911417990351b0e75e2595b1e6b32 Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Sat, 25 Feb 2017 08:54:38 -0600 Subject: [PATCH] don't attempt to garbage collect cells without formulae, closes #121 --- source/cell/cell.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/cell/cell.cpp b/source/cell/cell.cpp index 0dd78fd0..797c170c 100644 --- a/source/cell/cell.cpp +++ b/source/cell/cell.cpp @@ -490,8 +490,11 @@ std::string cell::formula() const void cell::clear_formula() { - d_->formula_.clear(); - worksheet().garbage_collect_formulae(); + if (has_formula()) + { + d_->formula_.clear(); + worksheet().garbage_collect_formulae(); + } } void cell::error(const std::string &error)