qt: fix possible infinite loading in RoundImage

correctly handle error for custom generators
This commit is contained in:
Prince Gupta 2024-03-11 12:11:52 +05:30 committed by Jean-Baptiste Kempf
parent 58a7aec106
commit cc922574c6
1 changed files with 4 additions and 0 deletions

View File

@ -283,7 +283,11 @@ namespace
auto textureFactory = std::unique_ptr<QQuickTextureFactory>(response->textureFactory());
auto img = !textureFactory ? QImage {} : textureFactory->image();
if (!textureFactory || img.isNull())
{
// source response failed, signal to parent
emit finished();
return;
}
response->disconnect(this);
response->deleteLater();