D29616: Fix memory errors caused by using dangling pointers to SensorClients in SensorAgent

Jiří Paleček noreply at phabricator.kde.org
Mon May 11 14:14:40 BST 2020


jpalecek added inline comments.

INLINE COMMENTS

> anthonyfieroni wrote in SensorBrowser.cpp:53
> When you delete the map content, all agents should loose their connections, no?

No, it only deletes the HostInfo structure. See the source <https://phabricator.kde.org/source/ksysguard/browse/master/gui/SensorBrowser.h$187>. It doesn't disconnect anything. Nor does deleting `this`, as the Agent holds the client as a bare pointer, it can't know that it ceased to exist. It isn't even a `QPointer` (probably bc. `SensorClient` isn't a `QObject`).

REPOSITORY
  R106 KSysguard

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

To: jpalecek, davidedmundson, ahiemstra
Cc: anthonyfieroni, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200511/1d8750d4/attachment.htm>


More information about the Plasma-devel mailing list