]> git.lizzy.rs Git - bspwm.git/commitdiff
Don't reset *num_clients* in *restore_tree*
authorBastien Dejean <nihilhill@gmail.com>
Thu, 19 Dec 2013 17:52:59 +0000 (18:52 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Thu, 19 Dec 2013 17:52:59 +0000 (18:52 +0100)
restore.c
tree.c

index 680c6a04725a45c665c6adcb845b74180c822ff9..a31a219a736069f7c0af0d23d2a697866673bbe6 100644 (file)
--- a/restore.c
+++ b/restore.c
@@ -54,7 +54,6 @@ void restore_tree(char *file_path)
     monitor_t *m = NULL;
     desktop_t *d = NULL;
     node_t *n = NULL;
-    num_clients = 0;
     unsigned int level, last_level = 0;
 
     while (fgets(line, sizeof(line), snapshot) != NULL) {
diff --git a/tree.c b/tree.c
index 0dc6aec4039d609708bd8ec9c99521bfd0199335..435a6e973527a8e613a763d02f68ea375c916d33 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -901,8 +901,10 @@ void destroy_tree(node_t *n)
         return;
     node_t *first_tree = n->first_child;
     node_t *second_tree = n->second_child;
-    if (n->client != NULL)
+    if (n->client != NULL) {
         free(n->client);
+        num_clients--;
+    }
     free(n);
     destroy_tree(first_tree);
     destroy_tree(second_tree);