summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-04-03 11:27:27 -0400
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-04-03 11:27:27 -0400
commit7afbe9284ff1ca2eece6da1838061cad9ed655e0 (patch)
tree5d5189467a1d5f7dc07b3e8d84ed81886a4771c0
parentdont deallocate in container_close (diff)
downloadsway-7afbe9284ff1ca2eece6da1838061cad9ed655e0.tar.gz
sway-7afbe9284ff1ca2eece6da1838061cad9ed655e0.tar.zst
sway-7afbe9284ff1ca2eece6da1838061cad9ed655e0.zip
rename _container_destroy to container_finish
-rw-r--r--sway/tree/container.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index cb407f0e..d9fc61e7 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -77,7 +77,7 @@ struct sway_container *container_create(enum sway_container_type type) {
77 return c; 77 return c;
78} 78}
79 79
80static struct sway_container *_container_destroy(struct sway_container *cont) { 80static struct sway_container *container_finish(struct sway_container *cont) {
81 if (cont == NULL) { 81 if (cont == NULL) {
82 return NULL; 82 return NULL;
83 } 83 }
@@ -124,13 +124,13 @@ static void reap_empty_func(struct sway_container *con, void *data) {
124 break; 124 break;
125 case C_CONTAINER: 125 case C_CONTAINER:
126 if (con->children->length == 0) { 126 if (con->children->length == 0) {
127 _container_destroy(con); 127 container_finish(con);
128 } else if (con->children->length == 1) { 128 } else if (con->children->length == 1) {
129 struct sway_container *only_child = con->children->items[0]; 129 struct sway_container *only_child = con->children->items[0];
130 if (only_child->type == C_CONTAINER) { 130 if (only_child->type == C_CONTAINER) {
131 container_remove_child(only_child); 131 container_remove_child(only_child);
132 container_replace_child(con, only_child); 132 container_replace_child(con, only_child);
133 _container_destroy(con); 133 container_finish(con);
134 } 134 }
135 } 135 }
136 case C_VIEW: 136 case C_VIEW:
@@ -146,6 +146,7 @@ struct sway_container *container_reap_empty(struct sway_container *container) {
146 return parent; 146 return parent;
147} 147}
148 148
149
149void container_destroy(struct sway_container *cont) { 150void container_destroy(struct sway_container *cont) {
150 if (cont == NULL) { 151 if (cont == NULL) {
151 return; 152 return;
@@ -155,7 +156,7 @@ void container_destroy(struct sway_container *cont) {
155 assert(false && "dont destroy containers with children"); 156 assert(false && "dont destroy containers with children");
156 } 157 }
157 158
158 _container_destroy(cont); 159 container_finish(cont);
159 container_reap_empty(&root_container); 160 container_reap_empty(&root_container);
160} 161}
161 162