]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Restore old move-assignment definition
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 25 Jun 2016 15:23:43 +0000 (03:23 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 25 Jun 2016 15:23:43 +0000 (03:23 +1200)
We cannot use the compilers default move assignment operator since we
have custom deletePointer() happening in the reset() call.

src/security/LockingPointer.h

index a5b2a431476a270113a5f489acc03d4203f7f5de..baaa32d345e3be3823c0ba1235144fd129293bed 100644 (file)
@@ -69,7 +69,11 @@ public:
 
     // move semantics are definitely okay, when possible
     explicit LockingPointer(SelfType &&) = default;
-    SelfType &operator =(SelfType &&) = default;
+    SelfType &operator =(SelfType &&o) {
+        if (o.get() != raw)
+            reset(o.release());
+        return *this;
+    }
 
     bool operator !() const { return !raw; }
     explicit operator bool() const { return raw; }