From: Alan Frindell Date: Mon, 19 Jun 2017 04:01:03 +0000 (-0700) Subject: Make DestructorCheck::Safety no-copy, no-move X-Git-Tag: v2017.06.19.00^0 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=60b2478a8e299bbae257a5fe69837696c0950ee5 Make DestructorCheck::Safety no-copy, no-move 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 --- diff --git a/folly/io/async/DestructorCheck.h b/folly/io/async/DestructorCheck.h index 2d9930fb..4e5346fb 100644 --- a/folly/io/async/DestructorCheck.h +++ b/folly/io/async/DestructorCheck.h @@ -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; }