From f1a399b223621b4c01636027a8eecf6e3dea192a Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Tue, 16 Nov 2021 10:13:03 +0100 Subject: [PATCH] fix crash when delete mesh with active decorator --- src/meshlab/glarea.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/meshlab/glarea.h b/src/meshlab/glarea.h index 8b4cab0ad..11859acc7 100644 --- a/src/meshlab/glarea.h +++ b/src/meshlab/glarea.h @@ -309,12 +309,14 @@ public slots: { MeshModel *m = md()->getMesh(i.key()); - foreach(QAction *p, i.value()) - { - DecoratePlugin * decorInterface = qobject_cast(p->parent()); - decorInterface->endDecorate(p, *m, this->glas.currentGlobalParamSet, this); - decorInterface->setLog(&md()->Log); - decorInterface->startDecorate(p, *m, this->glas.currentGlobalParamSet, this); + if (m != nullptr) { + foreach(QAction *p, i.value()) + { + DecoratePlugin * decorInterface = qobject_cast(p->parent()); + decorInterface->endDecorate(p, *m, this->glas.currentGlobalParamSet, this); + decorInterface->setLog(&md()->Log); + decorInterface->startDecorate(p, *m, this->glas.currentGlobalParamSet, this); + } } }