From 54a96bb67521e3fc633babe6d9aea86113eb2c74 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 30 Nov 2008 23:15:03 +0000 Subject: [PATCH] do not crash in xrun handler when there is no session git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4272 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour_ui.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 125fd18a77..32088800df 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2946,13 +2946,17 @@ ARDOUR_UI::halt_on_xrun_message () void ARDOUR_UI::xrun_handler(nframes_t where) { + if (!session) { + return; + } + ENSURE_GUI_THREAD (bind(mem_fun(*this, &ARDOUR_UI::xrun_handler), where)); - if (Config->get_create_xrun_marker() && session->actively_recording()) { + if (session && Config->get_create_xrun_marker() && session->actively_recording()) { create_xrun_marker(where); } - if (Config->get_stop_recording_on_xrun() && session->actively_recording()) { + if (session && Config->get_stop_recording_on_xrun() && session->actively_recording()) { halt_on_xrun_message (); } } -- 2.30.2