From 3adc5160379bad529313d5a7e7522fc446dedeb6 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Wed, 21 Feb 2018 05:01:05 +0100 Subject: [PATCH] fixed spurious rviz crash? --- visualization/motion_planning_tasks/src/task_panel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/visualization/motion_planning_tasks/src/task_panel.cpp b/visualization/motion_planning_tasks/src/task_panel.cpp index ae6072c6..2a008bda 100644 --- a/visualization/motion_planning_tasks/src/task_panel.cpp +++ b/visualization/motion_planning_tasks/src/task_panel.cpp @@ -260,10 +260,10 @@ void TaskView::onCurrentStageChanged(const QModelIndex ¤t, const QModelInd QAbstractItemModel *m = task ? task->getSolutionModel(task_index) : nullptr; view->sortByColumn(-1); view->setModel(m); - delete sm; // we don't store the selection model + if (sm) delete sm; // we don't store the selection model + sm = view->selectionModel(); - if (m) { - sm = view->selectionModel(); + if (sm) { connect(sm, SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(onCurrentSolutionChanged(QModelIndex,QModelIndex))); connect(sm, SIGNAL(selectionChanged(QItemSelection, QItemSelection)),