Code review comment for lp://staging/~lukas-kde/unity-notifications/fix-1453958

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

> When making a QSharedPointer use deleteLater, you should really pass in a
> custom deleter like so:
>
> QSharedPointer<MyClass> instance(new Myclass(param), &QObject::deleteLater)
>
> i.e. at object creation time. It's risky to grab the raw pointer from a shared
> pointer and ask it to delete at some point.

Ack, &QObject::deleteLater on construction and QSharedPointer::clear() when releasing it.

« Back to merge proposal