diff --git a/implementations/onblocks/datatreestore/DataTree.cpp b/implementations/onblocks/datatreestore/DataTree.cpp index 9d913371..e1e8ca94 100644 --- a/implementations/onblocks/datatreestore/DataTree.cpp +++ b/implementations/onblocks/datatreestore/DataTree.cpp @@ -126,6 +126,9 @@ const Key &DataTree::key() const { } void DataTree::flush() const { + // By grabbing a lock, we ensure that all modifying functions don't run currently and are therefore flushed + unique_lock lock(_mutex); + // We also have to flush the root node _rootNode->flush(); }