Skip to content

Commit 72ee7e1

Browse files
committed
IconGroupContainer/force_reposition: Fix crash (use after free)
1 parent 66679ca commit 72ee7e1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Widgets/IconGroupContainer.vala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,15 @@ namespace Gala {
153153

154154
foreach (var child in children) {
155155
if (child is IconGroup) {
156+
child.ref (); //The list only contains weak references so make sure the child isn't freed before it's added again
156157
remove_group ((IconGroup) child);
157158
}
158159
}
159160

160161
foreach (var child in children) {
161162
if (child is IconGroup) {
162163
add_group ((IconGroup) child);
164+
child.unref ();
163165
}
164166
}
165167
}

0 commit comments

Comments
 (0)