Found a workaround for Issue 5 to avoid segmentation faults. The data included in the created window are cleared, but the window itself is not destroyed, only when its parent is deleted -> here the MainWindow. It seems that child CloudViewer windows don't crash when deleted on application exit.

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1826 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2014-10-02 19:33:51 +00:00
parent 2badfb5faf
commit 0a807e8cde
6 changed files with 32 additions and 15 deletions
+7 -5
View File
@@ -407,8 +407,9 @@ void DatabaseViewer::updateIds()
std::map<int, int> nids = memory_->getNeighborsId(memory_->getLastWorkingSignature()->id(), 0, -1, true);
memory_->getMetricConstraints(uKeys(nids), poses_, links_, true);
ui_->spinBox_optimizationsFrom->setRange(1, memory_->getLastWorkingSignature()->id());
ui_->spinBox_optimizationsFrom->setValue(memory_->getLastWorkingSignature()->id());
int first = nids.begin()->first;
ui_->spinBox_optimizationsFrom->setRange(first, memory_->getLastWorkingSignature()->id());
ui_->spinBox_optimizationsFrom->setValue(first);
}
ui_->actionGenerate_TORO_graph_graph->setEnabled(false);
@@ -740,8 +741,8 @@ void DatabaseViewer::view3DMap()
progressDialog.incrementStep();
// create a window
QWidget * window = new QWidget(this, Qt::Window);
window->setAttribute(Qt::WA_DeleteOnClose);
QDialog * window = new QDialog(this, Qt::Window);
window->setModal(this->isModal());
window->setWindowTitle(tr("3D Map"));
window->setMinimumWidth(800);
window->setMinimumHeight(600);
@@ -752,8 +753,9 @@ void DatabaseViewer::view3DMap()
layout->addWidget(viewer);
viewer->setCameraLockZ(false);
window->setLayout(layout);
connect(window, SIGNAL(finished(int)), viewer, SLOT(clear()));
window->showNormal();
window->show();
for(std::map<int, Transform>::iterator iter = optimizedPoses.begin(); iter!=optimizedPoses.end(); ++iter)
{