diff --git a/common/pieceinf.cpp b/common/pieceinf.cpp index 746cf310..a512c410 100644 --- a/common/pieceinf.cpp +++ b/common/pieceinf.cpp @@ -59,6 +59,8 @@ void PieceInfo::SetModel(lcModel* Model, bool UpdateMesh, Project* CurrentProjec { mType = lcPieceInfoType::Model; mModel = Model; + delete mMesh; + mMesh = nullptr; } strncpy(mFileName, Model->GetProperties().mFileName.toLatin1().data(), sizeof(mFileName) - 1);