From 22209796627acfef17c53d4cf523eed3daa26c2b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 15 May 2012 01:52:08 +0000 Subject: Eliminate long-duration event locks by generated responses in pre_process(). This also fixes some correctness issues, since the state at pre_process() time is actually the state that needs to be broadcast to clients. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4416 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/events/CreatePatch.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/server/events/CreatePatch.cpp') diff --git a/src/server/events/CreatePatch.cpp b/src/server/events/CreatePatch.cpp index 68359a5b..8bb381a2 100644 --- a/src/server/events/CreatePatch.cpp +++ b/src/server/events/CreatePatch.cpp @@ -40,11 +40,11 @@ CreatePatch::CreatePatch(Engine& engine, const Resource::Properties& properties) : Event(engine, client, id, timestamp) , _path(path) + , _properties(properties) , _patch(NULL) , _parent(NULL) , _compiled_patch(NULL) , _poly(poly) - , _properties(properties) { } @@ -97,6 +97,8 @@ CreatePatch::pre_process() // Insert into EngineStore _engine.engine_store()->add(_patch); + _update = _patch->properties(); + Event::pre_process(); } @@ -118,9 +120,7 @@ CreatePatch::post_process() { respond(_status); if (!_status) { - // Don't send ports/nodes that have been added since prepare() - // (otherwise they would be sent twice) - _engine.broadcaster()->send_object(_patch, false); + _engine.broadcaster()->put(_path, _update); } } -- cgit v1.2.1