mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 11:17:51 -06:00
Fix the memory leak between different slicing cases
Change-Id: I43f043e360101ef7e9aa2cc3b0bf7070cf851680
This commit is contained in:
parent
2ac9267e42
commit
9c00469d7f
2 changed files with 11 additions and 3 deletions
|
@ -416,7 +416,7 @@ private:
|
||||||
friend class Print;
|
friend class Print;
|
||||||
|
|
||||||
PrintObject(Print* print, ModelObject* model_object, const Transform3d& trafo, PrintInstances&& instances);
|
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();
|
||||||
|
|
||||||
void config_apply(const ConfigBase &other, bool ignore_nonexistent = false) { m_config.apply(other, ignore_nonexistent); }
|
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); }
|
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); }
|
||||||
|
|
|
@ -84,6 +84,14 @@ PrintObject::PrintObject(Print* print, ModelObject* model_object, const Transfor
|
||||||
this->set_instances(std::move(instances));
|
this->set_instances(std::move(instances));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PrintObject::~PrintObject()
|
||||||
|
{
|
||||||
|
if (m_shared_regions && -- m_shared_regions->m_ref_cnt == 0) delete m_shared_regions;
|
||||||
|
clear_layers();
|
||||||
|
clear_support_layers();
|
||||||
|
clear_tree_support_layers();
|
||||||
|
}
|
||||||
|
|
||||||
PrintBase::ApplyStatus PrintObject::set_instances(PrintInstances &&instances)
|
PrintBase::ApplyStatus PrintObject::set_instances(PrintInstances &&instances)
|
||||||
{
|
{
|
||||||
for (PrintInstance &i : instances)
|
for (PrintInstance &i : instances)
|
||||||
|
@ -2375,9 +2383,9 @@ void PrintObject::remove_bridges_from_contacts(
|
||||||
int x0 = bbox.min.x();
|
int x0 = bbox.min.x();
|
||||||
int x1 = bbox.max.x();
|
int x1 = bbox.max.x();
|
||||||
int y0 = bbox.min.y();
|
int y0 = bbox.min.y();
|
||||||
int y1 = bbox.max.y();
|
int y1 = bbox.max.y();
|
||||||
const int grid_lw = int(w/2); // grid line width
|
const int grid_lw = int(w/2); // grid line width
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
if (fabs(surface.bridge_angle-0)<fabs(surface.bridge_angle-M_PI_2)) {
|
if (fabs(surface.bridge_angle-0)<fabs(surface.bridge_angle-M_PI_2)) {
|
||||||
int step = bbox_size(0) / ceil(bbox_size(0) / max_bridge_length);
|
int step = bbox_size(0) / ceil(bbox_size(0) / max_bridge_length);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue