From e1f0a6b73152a9ce6f88ee2ea2fd14a2673a128a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 16 Dec 2025 20:21:23 -0700 Subject: [PATCH] avoid crash during shutdown, caused by accessing a null session during pointer leave event handling --- gtk2_ardour/editor.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index b0dc79501b..199d4be434 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4029,8 +4029,10 @@ Editor::_get_preferred_edit_position (EditIgnoreOption ignore, bool from_context if (_dragging_playhead) { /* NOTE: since the user is dragging with the mouse, this operation will implicitly be Snapped */ where = timepos_t (_playhead_cursor->current_sample()); - } else { + } else if (_session) { where = timepos_t (_session->audible_sample()); + } else { + where = timepos_t (0); } DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("GPEP: use playhead @ %1\n", where)); break;