summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/server/events/Delete.cpp8
-rw-r--r--src/server/events/Delete.hpp2
2 files changed, 2 insertions, 8 deletions
diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp
index 54b6ace2..06a5cb95 100644
--- a/src/server/events/Delete.cpp
+++ b/src/server/events/Delete.cpp
@@ -45,7 +45,6 @@ Delete::Delete(Engine& engine,
, _ports_array(NULL)
, _compiled_graph(NULL)
, _disconnect_event(NULL)
- , _lock(engine.store()->mutex(), std::defer_lock)
{
if (Node::uri_is_path(uri)) {
_path = Node::uri_to_path(uri);
@@ -84,7 +83,8 @@ Delete::pre_process()
return Event::pre_process_done(Status::INTERNAL_ERROR, _path);
}
- _lock.lock();
+ // Take a writer lock while we modify the store
+ std::unique_lock<std::mutex> lock(_engine.store()->mutex());
_engine.store()->remove(iter, _removed_objects);
@@ -145,10 +145,6 @@ Delete::execute(ProcessContext& context)
void
Delete::post_process()
{
- if (_lock.owns_lock()) {
- _lock.unlock();
- }
-
_removed_bindings.reset();
Broadcaster::Transfer t(*_engine.broadcaster());
diff --git a/src/server/events/Delete.hpp b/src/server/events/Delete.hpp
index 9711ce16..30a53b12 100644
--- a/src/server/events/Delete.hpp
+++ b/src/server/events/Delete.hpp
@@ -81,8 +81,6 @@ private:
SPtr<ControlBindings::Bindings> _removed_bindings;
Store::Objects _removed_objects;
-
- std::unique_lock<std::mutex> _lock;
};
} // namespace Events