Use deleteLater in Part::slotWidgetDestroyed().

Review Request #125711 - Created Oct. 19, 2015 and submitted

Alex Merry
When a part's main widget is destroyed, we should not delete the part
immediately - both because deleting an object from inside one of its
signals is not safe generally, and because derived classes may well hold
QPointers to the widgets, expecting them to be cleared between the
widget being destroyed and the part being destroyed.

Unit tests for KParts pass.

Running akregator under valgrind no longer produces a bunch of "invalid reads" from KHTMLPart when switching around between articles.

Michael Pyne
Alex Merry
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit b72fc5e56579035bf987075e16324ef95ef8e3d4 by Alex Merry to branch master.
Allen Winter

Does anyone object if I backport this to kdelibs KDE/4.14 ?

  1. I certainly don't, and Michael Pyne suggested above that he might do it himself.

  2. done, backported to kdelibs KDE/4.14 branch with commit 4f7ea2f770cf062ef22293fbb21a086f3e0cbfcb