Attempt to fix rambling crash on Mac Asan

This commit is contained in:
enricoturri1966 2020-05-28 11:14:56 +02:00
parent 2904ee6e1a
commit 96db6aaadb
2 changed files with 4 additions and 9 deletions

View file

@ -1144,6 +1144,10 @@ void Preview::update_layers_slider_from_canvas(wxKeyEvent& event)
void Preview::update_moves_slider()
{
const GCodeViewer::SequentialView& view = m_canvas->get_gcode_sequential_view();
// this should not be needed, but it is here to try to prevent rambling crashes on Mac Asan
if (view.endpoints.last < view.endpoints.first)
return;
std::vector<double> values(view.endpoints.last - view.endpoints.first + 1);
unsigned int count = 0;
for (unsigned int i = view.endpoints.first; i <= view.endpoints.last; ++i)