summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2020-07-29 21:57:11 +0300
committerKonstantin Ritt <ritt.ks@gmail.com>2020-07-30 00:39:26 +0300
commit2f929f204dba0c28f06c6b74aeff891ec5538fe9 (patch)
tree399cb334e1b62ecd0361bbff09a10ccb90f361ef
parentb7eae59fdf8838a5d142109998ded4aa87f79e75 (diff)
BatchRenderer: fix potential memory leak
if the same LottieAnimation object is registered twice, without calling deregisterAnimator() first, we are leaking the BM objects tree and the pre-rendered frames Change-Id: I07ac06b5f0b7ba9cacf7b0b883fc3cdb9782a349 Reviewed-by: Rebecca Worledge <rebecca.worledge@theqtcompany.com>
-rw-r--r--src/imports/rasterrenderer/batchrenderer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/imports/rasterrenderer/batchrenderer.cpp b/src/imports/rasterrenderer/batchrenderer.cpp
index e1ad3c5..0cd2cc6 100644
--- a/src/imports/rasterrenderer/batchrenderer.cpp
+++ b/src/imports/rasterrenderer/batchrenderer.cpp
@@ -95,7 +95,9 @@ void BatchRenderer::registerAnimator(LottieAnimation *animator)
Entry *&entry = m_animData[animator];
if (entry) {
- delete (entry);
+ qDeleteAll(entry->frameCache);
+ delete entry->bmTreeBlueprint;
+ delete entry;
entry = nullptr;
}
Q_ASSERT(entry == nullptr);