summaryrefslogtreecommitdiffstats
path: root/src/server/events/DisconnectAll.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/events/DisconnectAll.cpp')
-rw-r--r--src/server/events/DisconnectAll.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp
index 23db5167..f355575a 100644
--- a/src/server/events/DisconnectAll.cpp
+++ b/src/server/events/DisconnectAll.cpp
@@ -16,6 +16,7 @@
*/
#include <boost/format.hpp>
+#include <glibmm/thread.h>
#include "raul/Array.hpp"
#include "raul/Maid.hpp"
@@ -98,7 +99,11 @@ DisconnectAll::maybe_remove_connection(ConnectionImpl* c)
void
DisconnectAll::pre_process()
{
+ Glib::RWLock::WriterLock lock(_engine.engine_store()->lock(), Glib::NOT_LOCK);
+
if (!_deleting) {
+ lock.acquire();
+
_parent = _engine.engine_store()->find_patch(_parent_path);
if (_parent == NULL) {
@@ -115,7 +120,8 @@ DisconnectAll::pre_process()
return;
}
- if (object->parent_patch() != _parent && object->parent()->parent_patch() != _parent) {
+ if (object->parent_patch() != _parent
+ && object->parent()->parent_patch() != _parent) {
_error = INVALID_PARENT_PATH;
QueuedEvent::pre_process();
return;