Added deallocation of Layers (PrintObject::m_layers) into the PrintObject destructor.

This commit is contained in:
Lukáš Hejl 2022-01-28 09:42:57 +01:00
parent 0726b46da2
commit e711cb50d0

View file

@ -346,8 +346,12 @@ private:
friend class Print;
PrintObject(Print* print, ModelObject* model_object, const Transform3d& trafo, PrintInstances&& instances);
~PrintObject() { if (m_shared_regions && -- m_shared_regions->m_ref_cnt == 0) delete m_shared_regions; }
~PrintObject() {
if (m_shared_regions && --m_shared_regions->m_ref_cnt == 0)
delete m_shared_regions;
clear_layers();
}
void config_apply(const ConfigBase &other, bool ignore_nonexistent = false) { m_config.apply(other, ignore_nonexistent); }
void config_apply_only(const ConfigBase &other, const t_config_option_keys &keys, bool ignore_nonexistent = false) { m_config.apply_only(other, keys, ignore_nonexistent); }
PrintBase::ApplyStatus set_instances(PrintInstances &&instances);