Commit a3c318dc authored by Jonathan Marten's avatar Jonathan Marten
Browse files

Fix view splitter actions not being updated when a view is closed

This happens because in ViewManager::sessionFinished(),
the 'view' is delayed deleted which means that it is not removed
from its containing splitter until the next event.  However,
toggleActionsBasedOnState() is called immediately which makes its
decisions based on the current splitter state with the view still
present.

In order to avoid any possible object lifetime issues caused by
changing the way the view is deleted, or trying to remove it from the
view immediately, the call of toggleActionsBasedOnState() is instead
delayed until the view has been destroyed (and therefore removed from
its splitter).
parent 25a24bf3
......@@ -481,7 +481,7 @@ void ViewManager::sessionFinished()
toplevelSplitter->handleMinimizeMaximize(false);
view->deleteLater();
connect(view, &QObject::destroyed, this, [this]() { toggleActionsBasedOnState(); });
// Only remove the controller from factory() if it's actually controlling
// the session from the sender.
......@@ -495,7 +495,6 @@ void ViewManager::sessionFinished()
if (!_sessionMap.empty()) {
updateTerminalDisplayHistory(view, true);
focusAnotherTerminal(toplevelSplitter);
toggleActionsBasedOnState();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment