From: Andrii Grynenko Date: Tue, 11 Apr 2017 06:14:38 +0000 (-0700) Subject: Fix Fiber::LocalData leak for large fiber locals X-Git-Tag: v2017.04.17.00~40 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=42f6e99cfd2780023c4684fb2f6aed101cf98bdb;p=folly.git Fix Fiber::LocalData leak for large fiber locals Summary: facepaw Reviewed By: yfeldblum Differential Revision: D4856227 fbshipit-source-id: 17a73d4d630c6efe1763bbd8aff8b7a2c7721c27 --- diff --git a/folly/fibers/Fiber.cpp b/folly/fibers/Fiber.cpp index 39dcc333..f5995de3 100644 --- a/folly/fibers/Fiber.cpp +++ b/folly/fibers/Fiber.cpp @@ -189,6 +189,10 @@ void Fiber::preempt(State state) { } } +Fiber::LocalData::~LocalData() { + reset(); +} + Fiber::LocalData::LocalData(const LocalData& other) : data_(nullptr) { *this = other; } diff --git a/folly/fibers/Fiber.h b/folly/fibers/Fiber.h index 0fcd903d..36af25eb 100644 --- a/folly/fibers/Fiber.h +++ b/folly/fibers/Fiber.h @@ -131,6 +131,7 @@ class Fiber { class LocalData { public: LocalData() {} + ~LocalData(); LocalData(const LocalData& other); LocalData& operator=(const LocalData& other);