Fix segfaults in OutputWidget

Authored by antonanikin on Sep 15 2018, 12:26 AM.

Description

Fix segfaults in OutputWidget

Summary:
This patch fixes regressions provided by D14931.

Steps to reproduce (my system is neon/bionic with Qt 5.11.1 and KDevelop/master):

  1. Start KDevelop and load some project
  2. Start project build
  3. Close KDevelop
  4. Segfault happens

Main problems:

  1. Incorrect signal processing. OutputWidget::updateFilter() slot is called from parent's destructor when m_tabwidget/m_stackwidget is deleted so we have destroyed m_views hash and segfault as a result.
  1. Incorrect QSharedPointer usage. All handled objects have QWidget as a parent so we have double-free problem and and segfault as a result.

BUG: 398615

Test Plan: Tested on different output widgets (KDevelop::IOutputView::OneView/HistoryView/MultipleView) with no segfaults. All our QTreeView/QSortFilterProxyModel objects are deleted (no memory leaks).

Reviewers: KDevelop, kossebau

Reviewed By: KDevelop, kossebau

Subscribers: kfunk, kossebau, vkorneev, kdevelop-devel

Tags: KDevelop

Differential Revision: https://phabricator.kde.org/D15326

Details

Committed
antonanikinSep 15 2018, 12:26 AM
Reviewer
KDevelop
Differential Revision
D15326: Fix segfaults in OutputWidget
Parents
R32:3a9bcdbf3357: Merge branch '5.3'
Branches
Unknown
Tags
Unknown