From e711cb50d0e9df7d72c6b418f0543516ff22c5f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Fri, 28 Jan 2022 09:42:57 +0100 Subject: [PATCH] Added deallocation of Layers (PrintObject::m_layers) into the PrintObject destructor. --- src/libslic3r/Print.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index c2babd53cc..b6e4802bbb 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -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);