summaryrefslogtreecommitdiff
path: root/gtk2_ardour/linux_vst_gui_support.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-01-01 21:56:12 +0100
committerRobin Gareus <robin@gareus.org>2020-01-01 21:56:12 +0100
commitc07e13b7aced96b35920acb373cce61555f3f5bb (patch)
tree93503426f52509064e97aca3e90a2492e04d3bd7 /gtk2_ardour/linux_vst_gui_support.cc
parenteccbdd10e0a9e383d3262220debd1a94e2789707 (diff)
Fix crash when X11 is not available for VST UIs
This should not happen -- VST gui_event_loop is only started if LXVST_XDisplay is not NULL. However the eventloop itself checks if LXVST_XDisplay is set, so this might happen with headless builds that still have access to a display, or due to some async event.
Diffstat (limited to 'gtk2_ardour/linux_vst_gui_support.cc')
-rw-r--r--gtk2_ardour/linux_vst_gui_support.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk2_ardour/linux_vst_gui_support.cc b/gtk2_ardour/linux_vst_gui_support.cc
index b25404b884..80ef0ec305 100644
--- a/gtk2_ardour/linux_vst_gui_support.cc
+++ b/gtk2_ardour/linux_vst_gui_support.cc
@@ -316,7 +316,8 @@ dispatch_x_events (XEvent* event, VSTState* vstfx)
any Xevents to all the UI callbacks plugins 'may' have registered on their
windows, that is if they don't manage their own UIs **/
-void* gui_event_loop (void* ptr)
+static void*
+gui_event_loop (void* ptr)
{
VSTState* vstfx;
int LXVST_sched_timer_interval = 40; //ms, 25fps
@@ -623,6 +624,11 @@ int vstfx_create_editor (VSTState* vstfx)
int x_size = 1;
int y_size = 1;
+ if (!LXVST_XDisplay) {
+ vstfx_error ("** ERROR ** VSTFX: No X11 Display available for plugin UI");
+ return -1;
+ }
+
/* Note: vstfx->lock is held while this function is called */
if (!(vstfx->plugin->flags & effFlagsHasEditor))