From 5fe7d79d30ec36b0ffb96bd907d8d6da37ed6e64 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 6 Jun 2014 15:28:36 -0400 Subject: [PATCH] Terminal: Fix crash when changing window size ... try 2 without a spurious \ sorry for the noise. From the commits list (Ingo) <<-EOF > Terminal crashes because fView is not connected to App Server when > this is called so calling fView->GetMouse() is not allowed. The interesting questions therefore are: 1) Why is the view not attached? 2) Why is it in the hyper link state? 1) is because the BTabView removes the non-selected tabs instead of just hiding them. The reason for 2) is that the tab was opened with Cmd+T (the bug is not reproducible when the tab is opened via menu item). Pressing Cmd causes hyper link state to be entered and switching to the new tab will leave the view in that state due to 1). Possible solutions: * TermView::_VisibleTextBufferChanged(): Call state hook only when attached to window. All other occurrences are safe as they are in BView hooks. * Leave the hyper link state when the view is detached from the window. A new dummy state could be active as long as the view is not attached, though using DefaultState would be harmless as well. EOF I chose solution 2 using DefaultState rather than creating a new dummy state. Thanks Ingo. Fixes #10902 --- src/apps/terminal/TermView.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index f06ab5f6db..8267c802bf 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -1215,6 +1215,8 @@ TermView::DetachedFromWindow() { be_clipboard->StopWatching(BMessenger(this)); + _NextState(fDefaultState); + delete fWinchRunner; fWinchRunner = NULL;