avoid crash during shutdown, caused by accessing a null session during pointer leave event handling

This commit is contained in:
Paul Davis 2025-12-16 20:21:23 -07:00
parent 8b1b1e2362
commit e1f0a6b731

View file

@ -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;