summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslcertificate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/ssl/qsslcertificate.cpp')
-rw-r--r--src/network/ssl/qsslcertificate.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index 9d8cfb0..018b2c2 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -159,7 +159,7 @@ QSslCertificate::QSslCertificate(const QByteArray &data, QSsl::EncodingFormat fo
/*!
Constructs an identical copy of \a other.
*/
-QSslCertificate::QSslCertificate(const QSslCertificate &other) : d(other.d)
+QSslCertificate::QSslCertificate(const QSslCertificate &other) : d(other.d.data())
{
d->ref.ref();
}
@@ -169,8 +169,6 @@ QSslCertificate::QSslCertificate(const QSslCertificate &other) : d(other.d)
*/
QSslCertificate::~QSslCertificate()
{
- if (!d->ref.deref())
- delete d;
}
/*!
@@ -179,7 +177,7 @@ QSslCertificate::~QSslCertificate()
*/
QSslCertificate &QSslCertificate::operator=(const QSslCertificate &other)
{
- qAtomicAssign(d, other.d);
+ d.assign(other.d.data());
return *this;
}
@@ -245,12 +243,7 @@ void QSslCertificate::clear()
{
if (isNull())
return;
- if (d->ref == 1)
- delete d;
- else
- d->ref.deref();
-
- d = new QSslCertificatePrivate;
+ d.reset(new QSslCertificatePrivate);
}
/*!