comparison framework/SVFileReader.cpp @ 693:3c5dc95bea91 by-id

Tidy
author Chris Cannam
date Wed, 17 Jul 2019 13:28:37 +0100
parents c8ba09756eff
children 94ca0ade69b6
comparison
equal deleted inserted replaced
692:ad5917362158 693:3c5dc95bea91
474 if (m_addedModels.find(modelId) != m_addedModels.end()) { 474 if (m_addedModels.find(modelId) != m_addedModels.end()) {
475 // already added this one 475 // already added this one
476 continue; 476 continue;
477 } 477 }
478 478
479 //!!! todo: review this (i.e. who causes the release of what) 479 m_document->addNonDerivedModel(modelId);
480 480
481 // don't want to add alignment models to the document, because 481 // make a note of all models that have been added to the
482 // their lifespans are entirely dictated by the models that 482 // document, so they don't get released by our own destructor
483 // "own" them even though they were read independently from
484 // the .sv file. (pity we don't have a nicer way to handle
485 // this)
486 if (!ModelById::isa<AlignmentModel>(modelId)) {
487 m_document->addNonDerivedModel(modelId);
488 }
489
490 // but we add all models including alignment ones to the added
491 // set, so they don't get released by our own destructor
492 m_addedModels.insert(modelId); 483 m_addedModels.insert(modelId);
493 } 484 }
494 } 485 }
495 486
496 bool 487 bool