Added deallocation of SupportLayers (PrintObject::m_support_layers) into the PrintObject destructor and fixed memory leak in modulate_extrusion_by_overlapping_layers().
This commit is contained in:
parent
7cc4b1d8b4
commit
dd3964c8c3
2 changed files with 3 additions and 1 deletions
|
@ -346,10 +346,11 @@ private:
|
|||
friend class Print;
|
||||
|
||||
PrintObject(Print* print, ModelObject* model_object, const Transform3d& trafo, PrintInstances&& instances);
|
||||
~PrintObject() {
|
||||
~PrintObject() override {
|
||||
if (m_shared_regions && --m_shared_regions->m_ref_cnt == 0)
|
||||
delete m_shared_regions;
|
||||
clear_layers();
|
||||
clear_support_layers();
|
||||
}
|
||||
|
||||
void config_apply(const ConfigBase &other, bool ignore_nonexistent = false) { m_config.apply(other, ignore_nonexistent); }
|
||||
|
|
|
@ -3754,6 +3754,7 @@ void modulate_extrusion_by_overlapping_layers(
|
|||
assert(path != nullptr);
|
||||
polylines.emplace_back(Polyline(std::move(path->polyline)));
|
||||
path_ends.emplace_back(std::pair<Point, Point>(polylines.back().points.front(), polylines.back().points.back()));
|
||||
delete path;
|
||||
}
|
||||
}
|
||||
// Destroy the original extrusion paths, their polylines were moved to path_fragments already.
|
||||
|
|
Loading…
Reference in a new issue