summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2019-04-03 13:49:20 +0300
committerRebecca Worledge <rebecca.worledge@theqtcompany.com>2019-04-09 03:30:50 +0000
commit738cf406be309034a529686ab79baad795be7544 (patch)
tree37bf6a861184a2fad3063b8a5e8cf1b854da2e13
parent03354671370a340637ae563871bb66d315913d15 (diff)
BatchRenderer: ensure the same animator won't be registered twice
Change-Id: I17d5e1ede276a4ce91bd95d28430e968464f09ee Reviewed-by: Rebecca Worledge <rebecca.worledge@theqtcompany.com>
-rw-r--r--src/imports/rasterrenderer/batchrenderer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/imports/rasterrenderer/batchrenderer.cpp b/src/imports/rasterrenderer/batchrenderer.cpp
index 5c4da48..cc168a6 100644
--- a/src/imports/rasterrenderer/batchrenderer.cpp
+++ b/src/imports/rasterrenderer/batchrenderer.cpp
@@ -78,7 +78,9 @@ void BatchRenderer::registerAnimator(LottieAnimation *animator)
qCDebug(lcLottieQtBodymovinRenderThread) << "Register Animator:"
<< static_cast<void*>(animator);
- Entry *entry = new Entry;
+ Entry *&entry = m_animData[animator];
+ Q_ASSERT(entry == nullptr);
+ entry = new Entry;
entry->animator = animator;
entry->startFrame = animator->startFrame();
entry->endFrame = animator->endFrame();
@@ -86,7 +88,6 @@ void BatchRenderer::registerAnimator(LottieAnimation *animator)
entry->animDir = animator->direction();
entry->bmTreeBlueprint = new BMBase;
parse(entry->bmTreeBlueprint, animator->jsonSource());
- m_animData.insert(animator, entry);
m_waitCondition.wakeAll();
}