/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2015-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace folly { namespace detail {
EventBaseLocalBase::~EventBaseLocalBase() {
- for (auto* evb : *eventBases_.rlock()) {
+ auto locked = eventBases_.rlock();
+ for (auto* evb : *locked) {
evb->runInEventBaseThread([ this, evb, key = key_ ] {
evb->localStorage_.erase(key);
evb->localStorageToDtor_.erase(this);