From d080206767aee4435f0a45366eae976e77a08a1c Mon Sep 17 00:00:00 2001 From: Guido Ranzuglia granzuglia Date: Tue, 27 Sep 2016 04:13:48 +0000 Subject: [PATCH] - avoided possible synchronization problems --- src/meshlab/filterthread.cpp | 9 +++++++-- src/meshlab/mainwindow_RunTime.cpp | 2 -- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/meshlab/filterthread.cpp b/src/meshlab/filterthread.cpp index ce95c77ab..a2c0e4907 100644 --- a/src/meshlab/filterthread.cpp +++ b/src/meshlab/filterthread.cpp @@ -85,9 +85,14 @@ void FilterThread::run() EnvWrap envwrap(env); _cur = this; _success = it->filterInterface->applyFilter(_fname, _md, envwrap, &localCallBack); + for (MeshModel* mm = _md.nextMesh(); mm != NULL; mm = _md.nextMesh(mm)) + vcg::tri::Allocator::CompactEveryVector(mm->cm); _cur = NULL; - it->filterInterface->glContext->removePerViewRenderindData(); - delete it->filterInterface->glContext; + if (it->filterInterface->glContext != NULL) + { + it->filterInterface->glContext->removePerViewRenderindData(); + delete it->filterInterface->glContext; + } } else throw MLException("There is not yet support for not-C++ filters."); diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index 59a30495b..52631efe4 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -1820,8 +1820,6 @@ void MainWindow::executeFilter(MeshLabXMLFilterContainer* mfc,const QMapnextMesh(); mm != NULL; mm = meshDoc()->nextMesh(mm)) - vcg::tri::Allocator::CompactEveryVector(mm->cm); emit filterExecuted(); //meshDoc()->renderState().clearState(); qApp->restoreOverrideCursor();