Skip to content
Snippets Groups Projects
Commit d7a6a2cc authored by Seth Hillbrand's avatar Seth Hillbrand :flag_il:
Browse files

Fix locking scheme for double-clicks

In some cases, the events may be driven in the same thread, which can
lead to a deadlock.  Instead of waiting for the lock, simply refuse to
run if a loading system in in progress.

Fixes #6606
parent 7eea344f
No related branches found
No related tags found
Loading
......@@ -317,7 +317,10 @@ void KICAD_MANAGER_FRAME::RunEeschema( const wxString& aProjectSchematicFileName
KIWAY_PLAYER* frame;
// Prevent multiple KiFace loading at one time
const std::lock_guard<std::mutex> lock( m_loading );
if( !m_loading.try_lock() )
return;
const std::lock_guard<std::mutex> lock( m_loading, std::adopt_lock );
try
{
......@@ -365,7 +368,10 @@ void KICAD_MANAGER_FRAME::OnRunSchLibEditor( wxCommandEvent& event )
KIWAY_PLAYER* frame;
// Prevent multiple KiFace loading at one time
const std::lock_guard<std::mutex> lock( m_loading );
if( !m_loading.try_lock() )
return;
const std::lock_guard<std::mutex> lock( m_loading, std::adopt_lock );
try
{
......@@ -394,7 +400,10 @@ void KICAD_MANAGER_FRAME::RunPcbNew( const wxString& aProjectBoardFileName )
KIWAY_PLAYER* frame;
// Prevent multiple KiFace loading at one time
const std::lock_guard<std::mutex> lock( m_loading );
if( !m_loading.try_lock() )
return;
const std::lock_guard<std::mutex> lock( m_loading, std::adopt_lock );
try
{
......@@ -440,7 +449,10 @@ void KICAD_MANAGER_FRAME::OnRunPcbFpEditor( wxCommandEvent& event )
KIWAY_PLAYER* frame;
// Prevent multiple KiFace loading at one time
const std::lock_guard<std::mutex> lock( m_loading );
if( !m_loading.try_lock() )
return;
const std::lock_guard<std::mutex> lock( m_loading, std::adopt_lock );
try
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment