summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-20 17:27:08 +0000
committerDavid Robillard <d@drobilla.net>2012-08-20 17:27:08 +0000
commite7e8876464377e3c222e15783c39af7e411a44a3 (patch)
treeaba472f263970b6610112430984ff8573292e2a4 /src/server
parentca951656aea2d9e9045ad20093020b6f670a55fb (diff)
downloadingen-e7e8876464377e3c222e15783c39af7e411a44a3.tar.gz
ingen-e7e8876464377e3c222e15783c39af7e411a44a3.tar.bz2
ingen-e7e8876464377e3c222e15783c39af7e411a44a3.zip
Fix crash (bad assertion) on high event rates (notably fast GUI parameter twiddling).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4730 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server')
-rw-r--r--src/server/PostProcessor.cpp1
-rw-r--r--src/server/PreProcessor.cpp8
2 files changed, 5 insertions, 4 deletions
diff --git a/src/server/PostProcessor.cpp b/src/server/PostProcessor.cpp
index 74493b51..783d1f35 100644
--- a/src/server/PostProcessor.cpp
+++ b/src/server/PostProcessor.cpp
@@ -41,7 +41,6 @@ PostProcessor::append(ProcessContext& context, Event* first, Event* last)
{
assert(first);
assert(last);
- assert(!last->next());
if (_head.get()) {
_tail.get()->next(first);
_tail = last;
diff --git a/src/server/PreProcessor.cpp b/src/server/PreProcessor.cpp
index d5662c1d..dbc88d4f 100644
--- a/src/server/PreProcessor.cpp
+++ b/src/server/PreProcessor.cpp
@@ -67,8 +67,10 @@ PreProcessor::event(Event* const ev)
unsigned
PreProcessor::process(ProcessContext& context, PostProcessor& dest, bool limit)
{
- if (!_head.get())
+ Event* const head = _head.get();
+ if (!head) {
return 0;
+ }
/* Limit the maximum number of queued events to process per cycle. This
makes the process callback (more) realtime-safe by preventing being
@@ -79,7 +81,7 @@ PreProcessor::process(ProcessContext& context, PostProcessor& dest, bool limit)
size_t num_events_processed = 0;
- Event* ev = _head.get();
+ Event* ev = head;
Event* last = ev;
while (ev && ev->is_prepared() && ev->time() < context.end()) {
@@ -99,7 +101,7 @@ PreProcessor::process(ProcessContext& context, PostProcessor& dest, bool limit)
Event* next = (Event*)last->next();
last->next(NULL);
assert(!last->next());
- dest.append(context, _head.get(), last);
+ dest.append(context, head, last);
_head = next;
if (!next)
_tail = NULL;