Make DestructorCheck::Safety no-copy, no-move v2017.06.19.00
authorAlan Frindell <afrind@fb.com>
Mon, 19 Jun 2017 04:01:03 +0000 (21:01 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 19 Jun 2017 04:05:47 +0000 (21:05 -0700)
Summary: It's not safe because of how it manipulates the linked list.  The intended usage is to declare it locally on the stack

Reviewed By: yfeldblum

Differential Revision: D5267507

fbshipit-source-id: 07a55eaee2c6a266bb233432f6a3383236594195

folly/io/async/DestructorCheck.h

index 2d9930fbfbb9027f14fef1e7dac6b6e02a0f67c9..4e5346fba84be91b9376fc7c1e5215b5b871783d 100644 (file)
@@ -108,6 +108,11 @@ class DestructorCheck {
       }
     }
 
+    Safety(const Safety&) = delete;
+    Safety(Safety&& goner) = delete;
+    Safety& operator=(const Safety&) = delete;
+    Safety& operator=(Safety&&) = delete;
+
     bool destroyed() const {
       return prev_ == nullptr;
     }