summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslcertificate.cpp
diff options
context:
space:
mode:
authorRobert Griebl <rgriebl@trolltech.com>2009-06-10 11:46:23 (GMT)
committerRobert Griebl <rgriebl@trolltech.com>2009-06-10 11:46:23 (GMT)
commit7604f8087f88171ef933d8ae08f501467e647338 (patch)
tree51d071f462ed48d0b25884d9f62b8ba11c5dff13 /src/network/ssl/qsslcertificate.cpp
parent8c265860b41214daade7c8a28237c1e07ea71a3c (diff)
downloadQt-7604f8087f88171ef933d8ae08f501467e647338.zip
Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.gz
Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.bz2
Make Qt exception safer.
Squashed commit of the branch haralds-haralds-qt-s60-topics/topic/exceptions, which also contains the full history. Rev-By: Harald Fernengel Rev-By: Ralf Engels
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 7b554dc..c4aa43e 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -155,7 +155,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();
}
@@ -165,8 +165,6 @@ QSslCertificate::QSslCertificate(const QSslCertificate &other) : d(other.d)
*/
QSslCertificate::~QSslCertificate()
{
- if (!d->ref.deref())
- delete d;
}
/*!
@@ -175,7 +173,7 @@ QSslCertificate::~QSslCertificate()
*/
QSslCertificate &QSslCertificate::operator=(const QSslCertificate &other)
{
- qAtomicAssign(d, other.d);
+ d.assign(other.d.data());
return *this;
}
@@ -241,12 +239,7 @@ void QSslCertificate::clear()
{
if (isNull())
return;
- if (d->ref == 1)
- delete d;
- else
- d->ref.deref();
-
- d = new QSslCertificatePrivate;
+ d.reset(new QSslCertificatePrivate);
}
/*!