OSDN Git Service

use qAtomicAssign() in QIcon::operator=()
authorIvailo Monev <xakepa10@gmail.com>
Wed, 24 Nov 2021 17:24:26 +0000 (19:24 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 24 Nov 2021 17:24:26 +0000 (19:24 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/image/qicon.cpp

index 2d4dfd4..1d35fd1 100644 (file)
@@ -529,11 +529,7 @@ QIcon::~QIcon()
 */
 QIcon &QIcon::operator=(const QIcon &other)
 {
-    if (other.d)
-        other.d->ref.ref();
-    if (d && !d->ref.deref())
-        delete d;
-    d = other.d;
+    qAtomicAssign(d, other.d);
     return *this;
 }