Fix clang-analyzer-cplusplus.NewDelete (Use of memory after it is freed)

This commit is contained in:
Robert Müller 2022-05-27 16:41:14 +02:00
parent a2465605df
commit 6a72c5c38b

View file

@ -537,7 +537,7 @@ void CAutoMapper::Proceed(CLayerTiles *pLayer, int ConfigID, int Seed, int SeedO
}
// clean-up
if(pRun->m_AutomapCopy)
if(pRun->m_AutomapCopy && pReadLayer != pLayer)
delete pReadLayer;
}
}