I am trying to load the image at runtime by calling the function_under_test() and as well add a picture marker symbol every time ,this has resulted in memory leak and when we try to clear it using the api scvImageGraphiOverLay->graphics()->clear(); still i have memory leaks .
void function_under_test(){
QByteArray data;
if(!file.open(QIODevice::ReadOnly))
{
return;
}
else
{
data=file.readAll();
}
file.close();
const unsigned char* lpchar = reinterpret_cast<const unsigned char *>(data.constData());
// Point pt1(airCraftPoint);
QImage testImg(lpchar, 1080, 1080, QImage::Format_RGB888);
scvImageSymbol = new PictureMarkerSymbol(testImg, this);
scvImageSymbol->setOpacity(0.5);scvImagetGraphic->setSymbol(scvImageSymbol);
scvImageGraphiOverLay->graphics()->clear();
scvImageGraphiOverLay->graphics()->append(scvImagetGraphic);
}
How to resolve memory leak issue related to picturemarkersymbol.
Solved! Go to Solution.
Looks like a duplicate post of https://community.esri.com/t5/qt-maps-sdk-questions/memory-leak-happens-when-we-are-updating-qimage/...