lottie/builder: fix a memory leak.

fixed a memory leak in an exceptional case.
This commit is contained in:
Hermet Park 2023-09-26 01:15:10 +09:00 committed by Hermet Park
parent 1819fed033
commit fdd90605c7

View file

@ -580,9 +580,15 @@ static void _updateImage(LottieGroup* parent, LottieImage* image, int32_t frameN
TaskScheduler::async(false);
if (image->size > 0) {
if (picture->load((const char*)image->b64Data, image->size, image->mimeType, false) != Result::Success) return;
if (picture->load((const char*)image->b64Data, image->size, image->mimeType, false) != Result::Success) {
delete(picture);
return;
}
} else {
if (picture->load(image->path) != Result::Success) return;
if (picture->load(image->path) != Result::Success) {
delete(picture);
return;
}
}
TaskScheduler::async(true);