diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 80ca177e7dc4..4a20ad942f5f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2016-09-27 Jonathan Wakely + + * include/debug/safe_iterator.h (_Safe_iterator::operator++()): Fix + lifetime of lock. + 2016-09-20 Jonathan Wakely * python/libstdcxx/v6/xmethods.py (DequeWorkerBase.__init__) diff --git a/libstdc++-v3/include/debug/safe_iterator.h b/libstdc++-v3/include/debug/safe_iterator.h index 1eea238b97ac..6e3113ae4244 100644 --- a/libstdc++-v3/include/debug/safe_iterator.h +++ b/libstdc++-v3/include/debug/safe_iterator.h @@ -329,7 +329,7 @@ namespace __gnu_debug _GLIBCXX_DEBUG_VERIFY(this->_M_incrementable(), _M_message(__msg_bad_inc) ._M_iterator(*this, "this")); - __gnu_cxx::__scoped_lock(this->_M_get_mutex()); + __gnu_cxx::__scoped_lock __l(this->_M_get_mutex()); ++base(); return *this; }