Prevent crashes on invalid use of tools
See https://gitlab.com/kicad/code/kicad/-/issues/15085
This commit is contained in:
parent
8fcd58038b
commit
2ae646136e
|
@ -663,6 +663,7 @@ void TOOL_MANAGER::RunMainStack( TOOL_BASE* aTool, std::function<void()> aFunc )
|
|||
{
|
||||
TOOL_STATE* st = m_toolState[aTool];
|
||||
setActiveState( st );
|
||||
wxCHECK( st->cofunc, /* void */ );
|
||||
st->cofunc->RunMainStack( std::move( aFunc ) );
|
||||
}
|
||||
|
||||
|
@ -678,6 +679,8 @@ TOOL_EVENT* TOOL_MANAGER::ScheduleWait( TOOL_BASE* aTool, const TOOL_EVENT_LIST&
|
|||
st->pendingWait = true;
|
||||
st->waitEvents = aConditions;
|
||||
|
||||
wxCHECK( st->cofunc, nullptr );
|
||||
|
||||
// switch context back to event dispatcher loop
|
||||
st->cofunc->KiYield();
|
||||
|
||||
|
|
Loading…
Reference in New Issue