[Development] API review for a new QDnsResolver class
peter.hartmann at nokia.com
Wed Nov 9 19:21:14 CET 2011
On 11/09/2011 06:43 PM, ext Jeremy Lainé wrote:
> A/ static QDnsReply* QDnsReply::lookup(QDnsReply::Type, QString);
> pro: easy to connect to the QDnsReply's signal
> con: it's entirely up to the user to handle deletion. Judging by your comments above, I
> doubt you favor it?
> B/ static QSharedPointer<QDnsReply> QDnsReply::lookup(QDnsReply::Type, QString);
> pro: memory ownership is explicit
> con: how used are our users to manipulating QSharedPointer with respect to signals and such?
I rather favour option B (lessons learned from QNAM), because I think
option A might lead to undeleted replies, which is what we experienced
in the case of
We probably can mitigate the complexity introduced by QSharedPointer by
having a simple example in the documentation.
However if people more favour option A, that would not be a problem for
> Development mailing list
> Development at qt-project.org
Qt Developer Days 2011 – REGISTER NOW!
October 24 – 26, Munich
November 29 – December 1, San Francisco
Learn more and Register at http://qt.nokia.com/qtdevdays2011
More information about the Development