Prevent RealTimeOperation EventQueue clogging

It can happen that the EventQueue fills up with
SessionEvent::RealTimeOperation. Those are to scheduled to be
free()ed later the GUI thread via event_loop->call_slot().

However it can happen that the GUI EventPool is full, so the request
to call Session::rt_cleanup, is never executed.

In this case the SessionEvent pool can fill up with RealTime
Operations which remain there permanently.
This commit is contained in:
Robin Gareus 2022-06-09 02:03:34 +02:00
parent 95aa39d1c4
commit b1b57571e7
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -24,6 +24,7 @@
#include "pbd/compose.h"
#include "ardour/audioengine.h"
#include "ardour/butler.h"
#include "ardour/monitor_control.h"
#include "ardour/route.h"
#include "ardour/session.h"
@ -160,7 +161,12 @@ Session::process_rtop (SessionEvent* ev)
ev->rt_slot ();
if (ev->event_loop) {
ev->event_loop->call_slot (MISSING_INVALIDATOR, boost::bind (ev->rt_return, ev));
if (!ev->event_loop->call_slot (MISSING_INVALIDATOR, boost::bind (ev->rt_return, ev))) {
/* The event must be deleted, otherwise the SessionEvent Pool may fill up */
if (!butler ()->delegate (boost::bind (ev->rt_return, ev))) {
ev->rt_return (ev);
}
}
} else {
warning << string_compose ("programming error: %1", X_("Session RT event queued from thread without a UI - cleanup in RT thread!")) << endmsg;
ev->rt_return (ev);