markg added a comment.

  Hmm, this is exactly the reason why i always go for either smart pointers or 
stack objects. Both prevent this issue from occurring in the first place.
  
  It's probably a bit much to make the Entry class own the objects (basically 
the diff of Albert). But there i would be a bit worried about needless copies.
  Which you can then prohibit by not allowing copies thus forcing move 
semantics, but then QList/QVector become unusable and you'd have to switch to 
std::vector. That is probably one step too far as well.
  
  So, the last possible solution that might work is:
  QList<QScopedPointer<Client>> m_clients;
  
  But i don't know enough about the Qt smart pointers to say for sure if that 
works as intended (aka, no leaks and no needless copies).

REPOSITORY
  R244 KCoreAddons

BRANCH
  master

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

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: dfaure, mpyne, aacid
Cc: markg, #frameworks

Reply via email to