D16553: Cache and delete old ConversationsDbusInterfaces to avoid memory leak

Simon Redman noreply at phabricator.kde.org
Mon Nov 5 03:12:25 GMT 2018


sredman added inline comments.

INLINE COMMENTS

> apol wrote in smsplugin.cpp:49
> Use take, so we don't have to look it up twice?

I don't think take works in this case: If the map does not contain the key, it will give a default-constructed value. We could then immediately delete it, but that would probably cause even more problems
Does passing an iterator to erase cause a second lookup? That seems silly

> apol wrote in smsplugin.h:134
> Why static?

Once the device disconnects, the plugin is destroyed. When it is re-created, we need access to the old pointer, thus a static variable

REPOSITORY
  R224 KDE Connect

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

To: sredman, #kde_connect, apol
Cc: apol, kdeconnect, shivanshukantprasad, skymoore, wistak, dvalencia, rmenezes, julioc, Leptopoda, timothyc, jdvr, yannux, Danial0_0, johnq, Pitel, adeen-s, SemperPeritus, daniel.z.tg, jeanv, seebauer, bugzy, MayeulC, menasshock, tctara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20181105/1a98ae8f/attachment.html>


More information about the KDEConnect mailing list