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 https://gitlab.com/kicad/code/kicad/issues/6606
(cherry picked from commit d7a6a2cc71
)
This commit is contained in:
parent
0533a23185
commit
0f9b01ee1d
|
@ -597,7 +597,10 @@ int KICAD_MANAGER_CONTROL::ShowPlayer( const TOOL_EVENT& aEvent )
|
||||||
KIWAY_PLAYER* player;
|
KIWAY_PLAYER* player;
|
||||||
|
|
||||||
// Prevent multiple KIWAY_PLAYER loading at one time
|
// Prevent multiple KIWAY_PLAYER loading at one time
|
||||||
const std::lock_guard<std::mutex> lock( m_loading );
|
if( !m_loading.try_lock() )
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
const std::lock_guard<std::mutex> lock( m_loading, std::adopt_lock );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue