Fixes crash when using the Copy Input To All Tabs feature
ClosedPublic

Authored by hallas on Mar 9 2019, 6:04 PM.

Details

Summary

Fixes crash when using the Copy Input To All Tabs feature. The crash is
caused because the sessions are removed from the SessionManager before
the MainWindow is updated. When the MainWindow receives the
activeViewChanged signal it assumes that the
SessionManager::sessionProfile returns a valid Profile pointer, but in
this case it has already been freed and is therefore nullptr. The fix is
to simply check if the new active Session has a valid Profile, if not
simply ignore it.

Test Plan
  1. Open Konsole window
  2. Open multiple tabs within that Konsole window
  3. (apparently an important piece) Scroll through the tabs and go back to the first one opened, on the far left of the tab bar
  4. Select Edit menu -> Copy Input To -> All Tabs in Current Window
  5. Type a ctrl-D to issue logout command to all tabs in window

BUG: 405158

Diff Detail

Repository
R319 Konsole
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
hallas created this revision.Mar 9 2019, 6:04 PM
Restricted Application added a project: Konsole. · View Herald TranscriptMar 9 2019, 6:04 PM
Restricted Application added a subscriber: konsole-devel. · View Herald Transcript
hallas requested review of this revision.Mar 9 2019, 6:04 PM
hindenburg accepted this revision.Mar 14 2019, 3:00 AM
hindenburg added a subscriber: hindenburg.

Thanks

This revision is now accepted and ready to land.Mar 14 2019, 3:00 AM
This revision was automatically updated to reflect the committed changes.