From f76b94c277c34855579486851517d03c314c8fde Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 30 Dec 2013 21:46:21 +0000 Subject: Fix occasional crashes and deadlocks on exit. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5229 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/Engine.cpp | 11 ++++++++++- src/server/events/SetPortValue.hpp | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index a7d77736..1f6fd70c 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -16,6 +16,8 @@ #include +#include + #include "lv2/lv2plug.in/ns/ext/buf-size/buf-size.h" #include "events/CreatePort.hpp" @@ -95,6 +97,13 @@ Engine::~Engine() _root_graph = NULL; deactivate(); + // Process all pending events + const FrameTime end = std::numeric_limits::max(); + _process_context.locate(_process_context.end(), end - _process_context.end()); + _post_processor->set_end_time(end); + _pre_processor->process(_process_context, *_post_processor, false); + _post_processor->process(); + const SPtr store = this->store(); if (store) { for (auto& s : *store.get()) { @@ -107,7 +116,6 @@ Engine::~Engine() _world->set_store(SPtr()); - delete _maid; delete _pre_processor; delete _post_processor; delete _block_factory; @@ -115,6 +123,7 @@ Engine::~Engine() delete _broadcaster; delete _event_writer; delete _worker; + delete _maid; _driver.reset(); diff --git a/src/server/events/SetPortValue.hpp b/src/server/events/SetPortValue.hpp index 0c4e8b11..852c694e 100644 --- a/src/server/events/SetPortValue.hpp +++ b/src/server/events/SetPortValue.hpp @@ -54,7 +54,7 @@ private: void apply(Context& context); PortImpl* _port; - const Atom _value; + const Atom _value; ControlBindings::Key _binding; }; -- cgit v1.2.1