diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index e5b530222e4a1..48b5cbecd95b9 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc @@ -385,8 +385,17 @@ class TabStrip::TabDragContextImpl : public TabDragContext, views::View::ConvertPointToScreen(view, &screen_location); // Note: `tab_strip_` can be destroyed during drag, also destroying `this`. + // Drag() may enter a nested run loop and re-home the TabDragController to + // another window's context, in which case the source window can be closed + // (freeing `this`) while the controller stays alive and returns kAlive. + // Track our own liveness, not the controller's. Mirrors the guard in + // vertical/vertical_tab_drag_handler.cc. + auto self = weak_factory_.GetWeakPtr(); const TabDragController::Liveness drag_controller_alive = drag_controller_->Drag(screen_location); + if (!self) { + return Liveness::kDeleted; + } return drag_controller_alive == TabDragController::Liveness::kAlive ? Liveness::kAlive