mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-20 06:52:03 +00:00
lottie/builder: fix a memory leak.
fixed a memory leak in an exceptional case.
This commit is contained in:
parent
1819fed033
commit
fdd90605c7
1 changed files with 8 additions and 2 deletions
|
@ -580,9 +580,15 @@ static void _updateImage(LottieGroup* parent, LottieImage* image, int32_t frameN
|
||||||
TaskScheduler::async(false);
|
TaskScheduler::async(false);
|
||||||
|
|
||||||
if (image->size > 0) {
|
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 {
|
} else {
|
||||||
if (picture->load(image->path) != Result::Success) return;
|
if (picture->load(image->path) != Result::Success) {
|
||||||
|
delete(picture);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskScheduler::async(true);
|
TaskScheduler::async(true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue