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

View File

@@ -1798,7 +1798,6 @@ void PreferencesDialog::selectSourceRGBD(Src src)
void PreferencesDialog::openDatabaseViewer()
{
DatabaseViewer * viewer = new DatabaseViewer(this);
viewer->setAttribute(Qt::WA_DeleteOnClose, true);
viewer->setWindowModality(Qt::WindowModal);
if(viewer->openDatabase(_ui->source_database_lineEdit_path->text()))
{
@@ -2978,16 +2977,19 @@ void PreferencesDialog::testOdometry(int type)
_odomThread = new OdometryThread(odometry); // take ownership of odometry
QWidget * window = new QWidget(this, Qt::Popup);
QDialog * window = new QDialog(this);
window->setWindowModality(Qt::WindowModal);
window->setAttribute(Qt::WA_DeleteOnClose);
window->setWindowFlags(Qt::Dialog);
window->setWindowTitle(tr("Odometry viewer"));
window->setMinimumWidth(800);
window->setMinimumHeight(600);
connect( window, SIGNAL(destroyed(QObject*)), this, SLOT(cleanOdometryTest()) );
connect( window, SIGNAL(finished(int)), this, SLOT(cleanOdometryTest()) );
OdometryViewer * odomViewer = new OdometryViewer(10, 2, 0.0, this->getOdomQualityWarnThr(), window);
OdometryViewer * odomViewer = new OdometryViewer(10,
_ui->spinBox_decimation_odom->value(),
_ui->doubleSpinBox_voxelSize_odom->value(),
this->getOdomQualityWarnThr(),
window);
connect( window, SIGNAL(finished(int)), odomViewer, SLOT(clear()) );
odomViewer->setCameraFree();
odomViewer->setGridShown(true);