Make folly::StrictConjunction usable under MSVC
[folly.git] / folly / fibers / Fiber.cpp
index 6caa9d551de08f6635cfc9853607cf7dc01f3366..f5995de31b2a3c5618b68b32425ee652664b8321 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -103,6 +103,9 @@ void Fiber::init(bool recordStackUsed) {
 
 Fiber::~Fiber() {
 #ifdef FOLLY_SANITIZE_ADDRESS
+  if (asanFakeStack_ != nullptr) {
+    fiberManager_.freeFakeStack(asanFakeStack_);
+  }
   fiberManager_.unpoisonFiberStack(this);
 #endif
   fiberManager_.stackAllocator_.deallocate(fiberStackLimit_, fiberStackSize_);
@@ -186,6 +189,10 @@ void Fiber::preempt(State state) {
   }
 }
 
+Fiber::LocalData::~LocalData() {
+  reset();
+}
+
 Fiber::LocalData::LocalData(const LocalData& other) : data_(nullptr) {
   *this = other;
 }