fixed spurious rviz crash?

This commit is contained in:
Robert Haschke 2018-02-21 05:01:05 +01:00
parent 12582f6bbc
commit 3adc516037

View File

@ -260,10 +260,10 @@ void TaskView::onCurrentStageChanged(const QModelIndex &current, 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)),