Review Request: single shot deleteLater needed in DataEngine::removeSource()

Jonathan Marten jjm at keelhaul.me.uk
Sat Nov 26 15:43:20 UTC 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103247/
-----------------------------------------------------------

Review request for Plasma.


Description
-------

The referenced bug describes a Plasma crash caused by a TaskSource (used by the "tasks" data engine) retaining a pointer to a Task.  When its associated window is closed, the Task is deleted but somehow the TaskSource is not.  This causes a dangling pointer crash when the TaskSource next gets the currentDesktopChanged() signal (and presumably also currentActivityChanged() if activities are in use).

The source should get deleted in DataEngine::removeSource() via deleteLater().  This does not seem to work - if a single shot timer is used instead (as also in commits 0f40b577 and 52783c6c), the TaskSource gets deleted correctly and the crash does not happen.

(This also resulted in a TaskSource memory leak).


This addresses bug 286353.
    http://bugs.kde.org/show_bug.cgi?id=286353


Diffs
-----

  plasma/dataengine.cpp c33b103 

Diff: http://git.reviewboard.kde.org/r/103247/diff/diff


Testing
-------

Verified that the TaskSource destructor is never called by adding a kDebug() there.

Built kdelibs and kdeworkspace with this change, used for day-to-day work (when the crash used to happen quite regularly) and with the crash scenario described in the bug.  The TaskSource destructor is called as expected, and the crash does not happen.


Thanks,

Jonathan Marten

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20111126/2c8b5683/attachment.html>


More information about the Plasma-devel mailing list