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();