Commit a5276bf9 authored by David Thompson's avatar David Thompson Committed by Kitware Robot

Merge topic 'close-model-crash-release' into release

3ff654fb Fix intermittent crash on model close.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: T.J. Corona's avatarT.J. Corona <tj.corona@kitware.com>
Merge-request: !904
parents 66fcbaeb 3ff654fb
......@@ -186,7 +186,7 @@ void qtModelEntityItem::updateItemData()
void qtModelEntityItem::refreshEntityItems()
{
if(this->Internals->EntityItemCombo)
if (this->Internals->EntityItemCombo)
{
this->Internals->EntityItemCombo->init();
}
......@@ -503,13 +503,16 @@ void qtModelEntityItem::onExpungeEntities(const smtk::model::EntityRefs& expunge
{
smtk::attribute::ModelEntityItemPtr modEntityItem =
dynamic_pointer_cast<ModelEntityItem>(this->getObject());
for (smtk::model::EntityRefs::const_iterator bit = expungedEnts.begin();
bit != expungedEnts.end(); ++bit)
if (!!modEntityItem)
{
std::ptrdiff_t idx = modEntityItem->find(*bit);
if (idx >= 0)
for (smtk::model::EntityRefs::const_iterator bit = expungedEnts.begin();
bit != expungedEnts.end(); ++bit)
{
modEntityItem->removeValue(static_cast<std::size_t>(idx));
std::ptrdiff_t idx = modEntityItem->find(*bit);
if (idx >= 0)
{
modEntityItem->removeValue(static_cast<std::size_t>(idx));
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment