Fixed integration tests.

This commit is contained in:
bubnikv 2018-12-03 16:25:21 +01:00
parent 3e0a06aa0e
commit 86e6f8bf33
2 changed files with 7 additions and 2 deletions

View file

@ -34,6 +34,7 @@ void Print::clear()
for (PrintRegion *region : m_regions) for (PrintRegion *region : m_regions)
delete region; delete region;
m_regions.clear(); m_regions.clear();
m_model.clear_objects();
} }
// Only used by the Perl test cases. // Only used by the Perl test cases.
@ -374,6 +375,9 @@ static PrintRegionConfig region_config_from_model_volume(const PrintRegionConfig
void Print::add_model_object(ModelObject* model_object, int idx) void Print::add_model_object(ModelObject* model_object, int idx)
{ {
tbb::mutex::scoped_lock lock(this->state_mutex()); tbb::mutex::scoped_lock lock(this->state_mutex());
// Add a copy of this ModelObject to this Print.
m_model.objects.emplace_back(ModelObject::new_copy(*model_object));
m_model.objects.back()->set_model(&m_model);
// Initialize a new print object and store it at the given position. // Initialize a new print object and store it at the given position.
PrintObject *object = new PrintObject(this, model_object); PrintObject *object = new PrintObject(this, model_object);
if (idx != -1) { if (idx != -1) {

View file

@ -76,9 +76,10 @@ void SLAPrint::clear()
tbb::mutex::scoped_lock lock(this->state_mutex()); tbb::mutex::scoped_lock lock(this->state_mutex());
// The following call should stop background processing if it is running. // The following call should stop background processing if it is running.
this->invalidate_all_steps(); this->invalidate_all_steps();
for (SLAPrintObject *object : m_objects)
for (SLAPrintObject *object : m_objects) delete object; delete object;
m_objects.clear(); m_objects.clear();
m_model.clear_objects();
} }
// Transformation without rotation around Z and without a shift by X and Y. // Transformation without rotation around Z and without a shift by X and Y.