diff --git a/common/lib_table_base.cpp b/common/lib_table_base.cpp index c6e2626adb..bfb815fbdb 100644 --- a/common/lib_table_base.cpp +++ b/common/lib_table_base.cpp @@ -185,10 +185,9 @@ LIB_TABLE_ROW* LIB_TABLE::findRow( const wxString& aNickName, bool aCheckIfEnabl LIB_TABLE_ROW* row = nullptr; LIB_TABLE* cur = (LIB_TABLE*) this; - std::lock_guard lock( m_nickIndexMutex ); - do { + std::lock_guard lock( cur->m_nickIndexMutex ); cur->ensureIndex(); for( const std::pair& entry : cur->nickIndex )