Commit b571db53 authored by Yumin Yuan's avatar Yumin Yuan

Merge pull request #246 from yumin/erase_model_bug

Fixed a bug in transferring model operator results when a model is removed
parents 68b231c8 5ee72fcb
......@@ -899,7 +899,17 @@ int ImportJSON::ofOperatorResult(cJSON* node, OperatorResult& resOut, smtk::mode
smtk::attribute::ModelEntityItemPtr expunged = resOut->findModelEntity("expunged");
std::size_t num = expunged->numberOfValues();
for (std::size_t i = 0; i < num; ++i)
expunged->value(i).manager()->erase(expunged->value(i));
{
// if this is a removed model, the children of the model should also be removed.
if(expunged->value(i).isModel())
{
expunged->value(i).manager()->eraseModel(expunged->value(i).as<smtk::model::Model>());
}
else
{
expunged->value(i).manager()->erase(expunged->value(i));
}
}
// Deserialize the relevant transcribed entities into the
// remote operator's model manager:
......
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