diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index 95d10ae53..00393c2f9 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -5255,6 +5255,20 @@ void PartPlateList::BedTextureInfo::TexturePart::update_buffer() } } +void PartPlateList::BedTextureInfo::TexturePart::reset() +{ + if (texture) + texture->reset(); + if (buffer) + delete buffer; +} + +void PartPlateList::BedTextureInfo::reset() +{ + for (size_t i = 0; i < parts.size(); i++) + parts[i].reset(); +} + void PartPlateList::init_bed_type_info() { BedTextureInfo::TexturePart pc_part1(10, 130, 10, 110, "bbl_bed_pc_left.svg"); @@ -5266,6 +5280,7 @@ void PartPlateList::init_bed_type_info() BedTextureInfo::TexturePart pte_part1(10, 80, 10, 160, "bbl_bed_pte_left.svg"); BedTextureInfo::TexturePart pte_part2(74, -10, 148, 12, "bbl_bed_pte_bottom.svg"); for (size_t i = 0; i < btCount; i++) { + bed_texture_info[i].reset(); bed_texture_info[i].parts.clear(); } bed_texture_info[btPC].parts.push_back(pc_part1); diff --git a/src/slic3r/GUI/PartPlate.hpp b/src/slic3r/GUI/PartPlate.hpp index c7c109a47..0644ede3a 100644 --- a/src/slic3r/GUI/PartPlate.hpp +++ b/src/slic3r/GUI/PartPlate.hpp @@ -607,8 +607,10 @@ public: } void update_buffer(); + void reset(); }; std::vector parts; + void reset(); }; static const unsigned int MAX_PLATES_COUNT = MAX_PLATE_COUNT;