OutlineModel: Potential fix for crashes-on-exit
AbandonedPublic

Authored by kfunk on Jan 14 2016, 9:24 PM.

Details

Reviewers
None
Summary

Valgrind trace:

==9586==    at 0x40F583B:
KDevelop::DocumentController::activateDocument(KDevelop::IDocument*,
KTextEditor::Range const&) (documentcontroller.cpp:793)
==9586==    by 0x2B4E3CBC: OutlineModel::activate(QModelIndex const&)
(outlinemodel.cpp:215)
==9586==    by 0x2B4E489E: OutlineWidget::activated(QModelIndex)
(outlinewidget.cpp:93)
==9586==    by 0x2B4E4AFA: call (qobjectdefs_impl.h:500)
==9586==    by 0x2B4E4AFA: call<QtPrivate::List<const QModelIndex &>,
void> (qobjectdefs_impl.h:519)
==9586==    by 0x2B4E4AFA: QtPrivate::QSlotObject<void
(OutlineWidget::*)(QModelIndex), QtPrivate::List<QModelIndex const&>,
void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
(qobject_impl.h:143)
==9586==    by 0x9F78616: QMetaObject::activate(QObject*, int, int,
void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.4.2)
==9586==    by 0x9362DC4: QAbstractItemView::activated(QModelIndex
const&) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.4.2)
==9586==    by 0x9366E4D:
QAbstractItemView::mouseReleaseEvent(QMouseEvent*) (in
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.4.2)
==9586==    by 0x93B0B92: QTreeView::mouseReleaseEvent(QMouseEvent*) (in
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.4.2)
==9586==    by 0x9154187: QWidget::event(QEvent*) (in
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.4.2)

Fix crash in TemplatePreviewToolView

How to reproduce:

  • Open an editor tab
  • Close Template Preview Tool View
  • Close this editor tab
  • Open Template Preview Tool View
  • Crash

Diff Detail

Repository
R33 KDevPlatform
Branch
5.0
Lint
No Linters Available
Unit
No Unit Test Coverage
kfunk updated this revision to Diff 1968.Jan 14 2016, 9:24 PM
kfunk retitled this revision from to OutlineModel: Potential fix for crashes-on-exit.
kfunk updated this object.
kfunk edited the test plan for this revision. (Show Details)
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptJan 14 2016, 9:24 PM
kfunk updated this object.Jan 15 2016, 11:28 AM
apol added a subscriber: apol.Jan 15 2016, 11:29 AM
apol added inline comments.
plugins/outlineview/outlinemodel.cpp
54

So now we're not tracking if the url changes?

apol added a comment.Jan 15 2016, 11:33 AM

Anyway, looks good to me, if it fixes the problems you found. +1

kfunk added inline comments.Jan 15 2016, 5:44 PM
plugins/outlineview/outlinemodel.cpp
54

That line got moved, see below

kfunk abandoned this revision.Jan 15 2016, 5:46 PM

Pushed:

commit ef7bdacfc5fe287734621c76bf37cd748f33272b
Author: Kevin Funk <kfunk@kde.org>
Date: Thu Jan 14 22:20:21 2016 +0100

Fix crash in TemplatePreviewToolView

commit 5cf370353de94250efb0fa31017056bdd9d33ef0
Author: Kevin Funk <kfunk@kde.org>
Date: Thu Jan 14 19:43:15 2016 +0100

OutlineModel: Potential fix for crashes-on-exit
mwolff added a subscriber: mwolff.Jan 17 2016, 12:10 PM
mwolff added inline comments.
plugins/filetemplates/templatepreviewtoolview.cpp
80

this and below is probably an optimization to prevent expensive operations while the preview is not visible. I also don't see how this is related to the crash backtrace. Can you elaborate?

kfunk added inline comments.Jan 18 2016, 9:36 AM
plugins/filetemplates/templatepreviewtoolview.cpp
80

Re. "optimization":
isVisible() is already checked in documentChanged. -> This patch does not pessimize.

Re. "backtrace":
Note this Differential consists of two separate commits. The backtrace was describing a crash which is fixed as part of the other commit.