Memory Leak while using picturemarkersymbol

414
1
Jump to solution
09-24-2023 11:56 PM
TASL_Virendra
New Contributor II

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.

0 Kudos
1 Solution

Accepted Solutions
1 Reply
LucasDanzinger
Esri Frequent Contributor
0 Kudos