From 60b2478a8e299bbae257a5fe69837696c0950ee5 Mon Sep 17 00:00:00 2001 From: Alan Frindell Date: Sun, 18 Jun 2017 21:01:03 -0700 Subject: [PATCH 1/1] 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 --- folly/io/async/DestructorCheck.h | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.34.1