do not crash in xrun handler when there is no session
authorPaul Davis <paul@linuxaudiosystems.com>
Sun, 30 Nov 2008 23:15:03 +0000 (23:15 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sun, 30 Nov 2008 23:15:03 +0000 (23:15 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4272 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui.cc

index 125fd18a77bef7264fe676038cfb87d38a94b0ca..32088800df228d4245a3d8523579b9a666741f34 100644 (file)
@@ -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 ();
        }
 }