D15326: Fix segfaults in OutputWidget

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Wed Sep 12 13:46:45 BST 2018


kossebau added a comment.


  I have seen related crashes, and think I understand the basic reasoning. Sadly right now I fail to reproduce the crashes though, no idea why, so I am also unsure if I understood the problem :)
  So just leaving initial comments, to be corrected during discussion.

INLINE COMMENTS

> outputwidget.cpp:204
> +    // QSharedPointer destructor.
> +    m_views.clear();
> +

Isn't m_views destroyed (and thus implicitely cleared) before reaching the  ~QWidget and ~QObject destructors where then any QObject-child-tree memory management is done?
So do we really need to explicitly call this here?

> outputwidget.cpp:209
> +    // such call.
> +    delete m_tabwidget;
> +    delete m_stackwidget;

This here might be more the actual issue, preventing the updateFilter slot being invoked during destruction because tabwidget or stackwidget emitting signals on their subwidgets being removed,

Not sure what is the better approach, only disconnecting from the currentChanged signals or straight deleting the widgets. Personally I tend to only handle the connections, and leave memory management of widgets completly to the Qt internals.

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D15326

To: antonanikin, #kdevelop
Cc: kossebau, vkorneev, kdevelop-devel, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180912/e945f078/attachment-0001.html>


More information about the KDevelop-devel mailing list