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 2d9930f..4e5346f 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;
     }