summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/World.cpp3
-rw-r--r--src/server/Engine.cpp12
2 files changed, 11 insertions, 4 deletions
diff --git a/src/World.cpp b/src/World.cpp
index c91724a6..43388c9c 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -22,6 +22,7 @@
#include <glibmm/module.h>
#include "ingen/Configuration.hpp"
+#include "ingen/EngineBase.hpp"
#include "ingen/LV2Features.hpp"
#include "ingen/Log.hpp"
#include "ingen/Module.hpp"
@@ -154,6 +155,8 @@ public:
~Impl()
{
+ engine->quit();
+
// Delete module objects but save pointers to libraries
typedef std::list<Glib::Module*> Libs;
Libs libs;
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index 1f6fd70c..922935c9 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -100,9 +100,11 @@ Engine::~Engine()
// Process all pending events
const FrameTime end = std::numeric_limits<FrameTime>::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();
+ while (!_pre_processor->empty()) {
+ _post_processor->set_end_time(end);
+ _pre_processor->process(_process_context, *_post_processor, false);
+ _post_processor->process();
+ }
const SPtr<Store> store = this->store();
if (store) {
@@ -354,7 +356,9 @@ Engine::pending_events()
void
Engine::enqueue_event(Event* ev)
{
- _pre_processor->event(ev);
+ if (!_quit_flag) {
+ _pre_processor->event(ev);
+ }
}
unsigned