[Interest] How to delete a QSGTexture from a QSGSimpleTexture before set another texture?

Nuno Santos nunosantos at imaginando.pt
Tue Jun 27 20:59:39 CEST 2017


Hi,

I have the following code:

_textureNode->setTexture(_window->createTextureFromImage(...)));

I want to delete the current texture before creating a new one. I having a leak here and I suspect that’s because I’m creating a new texture without deleting the previous

I have tried to do the following:

QSGTexture *t = _textureNode->texture();

if (t) {
_textureNode->setTexture(0);
delete t;
}

and then

_textureNode->setTexture(_window->createTextureFromImage(...)));

But it crashed….

Any ideas?

Thanks!

Regards,

Nuno






More information about the Interest mailing list