mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-27 21:19:18 +00:00
Fix use-after free in ase_ungroup_all()
Anyway this code is not used anymore, it was for v1.1 when v1.1 and v1.2 branches were developed at the same time (layer groups feature was added in v1.2, so v1.1 just moved groups children to the root).
This commit is contained in:
parent
52afc9e9a7
commit
7aca017a58
@ -1696,8 +1696,12 @@ static void ase_ungroup_all(LayerGroup* group)
|
||||
|
||||
for (Layer* child : list) {
|
||||
if (child->isGroup()) {
|
||||
ase_ungroup_all(static_cast<LayerGroup*>(child));
|
||||
group->removeLayer(child);
|
||||
auto* childGroup = static_cast<LayerGroup*>(child);
|
||||
ase_ungroup_all(childGroup);
|
||||
group->removeLayer(childGroup);
|
||||
|
||||
ASSERT(childGroup->layersCount() == 0);
|
||||
delete childGroup;
|
||||
}
|
||||
else if (group != root) {
|
||||
// Create a new name adding all group layer names
|
||||
@ -1715,11 +1719,6 @@ static void ase_ungroup_all(LayerGroup* group)
|
||||
root->addLayer(child);
|
||||
}
|
||||
}
|
||||
|
||||
if (group != root) {
|
||||
ASSERT(group->layersCount() == 0);
|
||||
delete group;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace app
|
||||
|
Loading…
Reference in New Issue
Block a user