[Konsole-devel] [konsole] [Bug 331724] (frameworks) Crash on close [Konsole::StackedViewContainer::removeViewWidget, QStackedWidget::indexOf]

Aurelien Gateau agateau at kde.org
Fri Jun 20 12:04:49 UTC 2014


https://bugs.kde.org/show_bug.cgi?id=331724

Aurelien Gateau <agateau at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CONFIRMED                   |RESOLVED
         Resolution|---                         |FIXED
      Latest Commit|                            |http://commits.kde.org/kons
                   |                            |ole/dd1b2b4df04f13bb2a9f3bc
                   |                            |ef106dc3604c5fc1a

--- Comment #6 from Aurelien Gateau <agateau at kde.org> ---
Git commit dd1b2b4df04f13bb2a9f3bcef106dc3604c5fc1a by Aurélien Gâteau.
Committed on 19/06/2014 at 14:24.
Pushed by gateau into branch 'frameworks'.

Fix crash on close

Move code responsible for 'forgetting' a view outside of code responding to the
TerminalDisplay deletion.

This avoids a loop like this:

~MainWindow
=> ~QStackedWidget
=> ~TerminalDisplay
=> QObject::destroyed
=> ViewContainer::viewDestroyed
=> ViewContainer::removeViewWidget
   - internal cleanup
   - try to remove TerminalDisplay from QStackedWidget which is being deleted
and
crash

Instead the code now does:

~MainWindow
=> ~QStackedWidget
=> ~TerminalDisplay
=> QObject::destroyed
=> ViewContainer::viewDestroyed
=> ViewContainer::forgetView (does the internal clean up)

And if one tries to explicitly remove a view, sequence is:

ViewContainer::removeView
=> ViewContainer::forgetView
=> ViewContainer::removeViewWidget

The patch also removes ViewManager::focusActiveView() because it causes a crash
when closing a TerminalDisplay as it tries to put the focus on the deleted
TerminalDisplay. I initially called it through a queued connection, but
realized
it is actually not needed for focus to be passed to the correct view, so just
removed it.
REVIEW: 118839

M  +15   -29   src/ViewContainer.cpp
M  +3    -0    src/ViewContainer.h
M  +0    -20   src/ViewManager.cpp
M  +0    -1    src/ViewManager.h
M  +7    -2    src/ViewSplitter.cpp

http://commits.kde.org/konsole/dd1b2b4df04f13bb2a9f3bcef106dc3604c5fc1a

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the konsole-devel mailing list