mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-14 20:15:56 +08:00
Fix arrange crash with ASAN
This commit is contained in:
parent
7fe691f14e
commit
177a96a768
@ -33,10 +33,16 @@ protected:
|
|||||||
// then it should be removed from the list
|
// then it should be removed from the list
|
||||||
auto it = c.begin();
|
auto it = c.begin();
|
||||||
while (it != c.end() && !stopcond_()) {
|
while (it != c.end() && !stopcond_()) {
|
||||||
Placer p{bin};
|
|
||||||
p.configure(pcfg);
|
// WARNING: The copy of itm needs to be created before Placer.
|
||||||
|
// Placer is working with references and its destructor still
|
||||||
|
// manipulates the item this is why the order of stack creation
|
||||||
|
// matters here.
|
||||||
const Item& itm = *it;
|
const Item& itm = *it;
|
||||||
Item cpy{itm};
|
Item cpy{itm};
|
||||||
|
|
||||||
|
Placer p{bin};
|
||||||
|
p.configure(pcfg);
|
||||||
if (!p.pack(cpy)) it = c.erase(it);
|
if (!p.pack(cpy)) it = c.erase(it);
|
||||||
else it++;
|
else it++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user