diff --git a/pcbnew/connectivity/connectivity_algo.cpp b/pcbnew/connectivity/connectivity_algo.cpp index f5dae8b5d5..a96e9ff5e5 100644 --- a/pcbnew/connectivity/connectivity_algo.cpp +++ b/pcbnew/connectivity/connectivity_algo.cpp @@ -228,6 +228,7 @@ void CN_CONNECTIVITY_ALGO::RemoveInvalidRefs() void CN_CONNECTIVITY_ALGO::searchConnections() { + std::lock_guard lock( m_mutex ); #ifdef PROFILE PROF_TIMER garbage_collection( "garbage-collection" ); #endif diff --git a/pcbnew/connectivity/connectivity_algo.h b/pcbnew/connectivity/connectivity_algo.h index 641273edde..9954f715d7 100644 --- a/pcbnew/connectivity/connectivity_algo.h +++ b/pcbnew/connectivity/connectivity_algo.h @@ -298,6 +298,8 @@ private: bool m_isLocal; std::shared_ptr m_globalConnectivityData; + std::mutex m_mutex; + PROGRESS_REPORTER* m_progressReporter = nullptr; };