mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 00:31:11 -06:00
Bugfix: early object destruction caused a segfault when splitting. Also fixed a memory leak and restore background processing when split only detected one part. #2466 #2398
This commit is contained in:
parent
494efe65b2
commit
c4832c5342
3 changed files with 12 additions and 9 deletions
|
@ -13,7 +13,7 @@ Model::Model(const Model &other)
|
|||
// copy objects
|
||||
this->objects.reserve(other.objects.size());
|
||||
for (ModelObjectPtrs::const_iterator i = other.objects.begin(); i != other.objects.end(); ++i)
|
||||
this->add_object(**i);
|
||||
this->add_object(**i, true);
|
||||
}
|
||||
|
||||
Model& Model::operator= (Model other)
|
||||
|
@ -618,6 +618,7 @@ ModelObject::split(ModelObjectPtrs* new_objects)
|
|||
new_volume->material_id(volume->material_id());
|
||||
|
||||
new_objects->push_back(new_object);
|
||||
delete *mesh;
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
@ -42,9 +42,9 @@ template <class T>
|
|||
class Ref {
|
||||
T* val;
|
||||
public:
|
||||
Ref() {}
|
||||
Ref() : val(NULL) {}
|
||||
Ref(T* t) : val(t) {}
|
||||
operator T*() const {return val; }
|
||||
operator T*() const { return val; }
|
||||
static const char* CLASS() { return ClassTraits<T>::name_ref; }
|
||||
};
|
||||
|
||||
|
@ -52,10 +52,10 @@ template <class T>
|
|||
class Clone {
|
||||
T* val;
|
||||
public:
|
||||
Clone() : val() {}
|
||||
Clone() : val(NULL) {}
|
||||
Clone(T* t) : val(new T(*t)) {}
|
||||
Clone(const T& t) : val(new T(t)) {}
|
||||
operator T*() const {return val; }
|
||||
operator T*() const { return val; }
|
||||
static const char* CLASS() { return ClassTraits<T>::name; }
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue