diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-07-31 14:38:48 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-08-02 21:40:29 +0000 |
commit | 01a380405e05ad18251ec6635c096392c89633a7 (patch) | |
tree | ae89c2d45c08fa9ff3574be428a0bca989922209 /src/core/nodes/qcomponent.cpp | |
parent | ef4ee5a2d31910e0109ba0d6eda1d2a6bfc3124c (diff) |
Do not add duplicate entities to the component-to-entities map
We can encounter attempts to register the same entity for a component.
This should silently do nothing.
Task-number: QTBUG-47486
Change-Id: I984c554e8a05db7e8e07c86d551837ab039df92b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/core/nodes/qcomponent.cpp')
-rw-r--r-- | src/core/nodes/qcomponent.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/nodes/qcomponent.cpp b/src/core/nodes/qcomponent.cpp index cb6c78dd4..922f419e2 100644 --- a/src/core/nodes/qcomponent.cpp +++ b/src/core/nodes/qcomponent.cpp @@ -60,7 +60,7 @@ void QComponentPrivate::addEntity(QEntity *entity) { m_entities.append(entity); - if (m_scene != Q_NULLPTR) { + if (m_scene != Q_NULLPTR && !m_scene->hasEntityForComponent(m_id, entity->id())) { if (!m_shareable && !m_scene->entitiesForComponent(m_id).isEmpty()) qWarning() << "Trying to assign a non shareable component to more than one Entity"; m_scene->addEntityForComponent(m_id, entity->id()); |