From 1e510f66efde8f78c8289083d952862fd905b25d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 3 Sep 2011 16:30:15 -0400 Subject: [PATCH] Bug - Fixed nasty bug whereby TF2::clear wiped the file names (pending.data etc) and so any subsequent TDB2::commit never even opened the file. Yikes. --- src/TDB2.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/TDB2.cpp b/src/TDB2.cpp index 85e1e44cc..d4d908108 100644 --- a/src/TDB2.cpp +++ b/src/TDB2.cpp @@ -410,7 +410,9 @@ void TF2::clear () _loaded_contents = false; _contents = ""; - _file._data = ""; + + // Note that the actual file name is deliberately not cleared. + //_file._data = ""; _tasks.clear (); _added_tasks.clear (); @@ -474,16 +476,6 @@ const std::string TF2::dump () return std::string (buffer); } -//////////////////////////////////////////////////////////////////////////////// - - - - - - - - - //////////////////////////////////////////////////////////////////////////////// TDB2::TDB2 () : _location ("") @@ -492,8 +484,8 @@ TDB2::TDB2 () } //////////////////////////////////////////////////////////////////////////////// -// Deliberately no file writes on destruct. TDB2::commit should have been -// already called, if data is to be preserved. +// Deliberately no file writes on destruct. Commit should have been already +// called, if data is to be preserved. TDB2::~TDB2 () { }