IconGroupContainer/force_reposition: Fix crash (use after free)

This commit is contained in:
Leonhard Kargl 2024-07-28 12:12:51 +02:00
parent 66679ca796
commit 72ee7e1d75

View File

@ -153,6 +153,7 @@ namespace Gala {
foreach (var child in children) {
if (child is IconGroup) {
child.ref (); //The list only contains weak references so make sure the child isn't freed before it's added again
remove_group ((IconGroup) child);
}
}
@ -160,6 +161,7 @@ namespace Gala {
foreach (var child in children) {
if (child is IconGroup) {
add_group ((IconGroup) child);
child.unref ();
}
}
}