diff --git a/common/tool/tool_event.cpp b/common/tool/tool_event.cpp index c9a1d4b4a4..ec640a0c4a 100644 --- a/common/tool/tool_event.cpp +++ b/common/tool/tool_event.cpp @@ -219,3 +219,10 @@ bool TOOL_EVENT::IsMoveTool() const return( m_commandStr.is_initialized() && m_commandStr.get().find( "InteractiveMove" ) != GetCommandStr()->npos ); } + + +bool TOOL_EVENT::IsSimulator() const +{ + return( m_commandStr.is_initialized() + && m_commandStr.get().find( "Simulation" ) != GetCommandStr()->npos ); +} \ No newline at end of file diff --git a/include/tool/tool_event.h b/include/tool/tool_event.h index 22f993fb9c..9337e57744 100644 --- a/include/tool/tool_event.h +++ b/include/tool/tool_event.h @@ -418,6 +418,11 @@ public: */ bool IsMoveTool() const; + /** + * Indicate if the event is from the simulator. + */ + bool IsSimulator() const; + /** * Return a non-standard parameter assigned to the event. Its meaning depends on the * target tool. diff --git a/include/tool/tool_manager.h b/include/tool/tool_manager.h index 06632b3d06..aac2248455 100644 --- a/include/tool/tool_manager.h +++ b/include/tool/tool_manager.h @@ -266,6 +266,11 @@ public: */ inline void PostEvent( const TOOL_EVENT& aEvent ) { + // Horrific hack, but it's a crash bug. Don't let inter-frame commands stack up + // waiting to be processed. + if( aEvent.IsSimulator() && m_eventQueue.back().IsSimulator() ) + m_eventQueue.pop_back(); + m_eventQueue.push_back( aEvent ); }