| Index: base/supports_user_data.cc
|
| diff --git a/base/supports_user_data.cc b/base/supports_user_data.cc
|
| index 2a0263ed0d1881e6552f04b44a34fadf3e441cb2..9689014d4ad8ebe08b487e228f7fa67b6e052e7f 100644
|
| --- a/base/supports_user_data.cc
|
| +++ b/base/supports_user_data.cc
|
| @@ -35,6 +35,11 @@ void SupportsUserData::DetachUserDataThread() {
|
|
|
| SupportsUserData::~SupportsUserData() {
|
| DCHECK(thread_checker_.CalledOnValidThread() || user_data_.empty());
|
| + DataMap local_user_data;
|
| + user_data_.swap(local_user_data);
|
| + // Now this->user_data_ is empty, and any destructors called transitively from
|
| + // the destruction of |local_user_data| will see it that way instead of
|
| + // examining a being-destroyed object.
|
| }
|
|
|
| } // namespace base
|
|
|