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
This commit is contained in:
John Scipione
2014-06-06 15:28:36 -04:00
parent 0bdf33686c
commit 5fe7d79d30
+2
View File
@@ -1215,6 +1215,8 @@ TermView::DetachedFromWindow()
{
be_clipboard->StopWatching(BMessenger(this));
_NextState(fDefaultState);
delete fWinchRunner;
fWinchRunner = NULL;