mirror of
https://github.com/NickHu/sway
synced 2025-01-16 15:41:47 +01:00
container_destroy: fix segfault
cont->children doesn't have to be NULL when there is no children
This commit is contained in:
parent
1fd21650d7
commit
de65d05821
1 changed files with 1 additions and 1 deletions
|
@ -104,7 +104,7 @@ static void _container_destroy(struct sway_container *cont) {
|
||||||
if (cont->children != NULL && cont->children->length) {
|
if (cont->children != NULL && cont->children->length) {
|
||||||
// remove children until there are no more, container_destroy calls
|
// remove children until there are no more, container_destroy calls
|
||||||
// container_remove_child, which removes child from this container
|
// container_remove_child, which removes child from this container
|
||||||
while (cont->children != NULL) {
|
while (cont->children != NULL && cont->children->length > 0) {
|
||||||
struct sway_container *child = cont->children->items[0];
|
struct sway_container *child = cont->children->items[0];
|
||||||
container_remove_child(child);
|
container_remove_child(child);
|
||||||
_container_destroy(child);
|
_container_destroy(child);
|
||||||
|
|
Loading…
Reference in a new issue