]> git.sur5r.net Git - i3/i3/blobdiff - src/load_layout.c
Merge pull request #2507 from stapelberg/autotools
[i3/i3] / src / load_layout.c
index 9856d07851be72c8c0779f9cc99b3efb73cdcb4c..7004a85970b8752b1ecc8d918e7f4993a47c0c10 100644 (file)
@@ -1,5 +1,3 @@
-#undef I3__FILE__
-#define I3__FILE__ "load_layout.c"
 /*
  * vim:ts=4:sw=4:expandtab
  *
@@ -48,6 +46,7 @@ static int json_start_map(void *ctx) {
         LOG("creating new swallow\n");
         current_swallow = smalloc(sizeof(Match));
         match_init(current_swallow);
+        current_swallow->dock = M_DONTCHECK;
         TAILQ_INSERT_TAIL(&(json_node->swallow_head), current_swallow, matches);
         swallow_is_empty = true;
     } else {
@@ -87,6 +86,7 @@ static int json_end_map(void *ctx) {
                 Match *match = TAILQ_FIRST(&(json_node->swallow_head));
                 TAILQ_REMOVE(&(json_node->swallow_head), match, matches);
                 match_free(match);
+                free(match);
             }
         }
 
@@ -149,7 +149,7 @@ static int json_end_map(void *ctx) {
         LOG("attaching\n");
         con_attach(json_node, json_node->parent, true);
         LOG("Creating window\n");
-        x_con_init(json_node, json_node->depth);
+        x_con_init(json_node);
         json_node = json_node->parent;
     }
 
@@ -640,8 +640,11 @@ void tree_append_json(Con *con, const char *filename, char **errormsg) {
 
     setlocale(LC_NUMERIC, "");
     yajl_complete_parse(hand);
+    yajl_free(hand);
+    yajl_gen_free(g);
 
     fclose(f);
+    free(buf);
     if (to_focus)
         con_focus(to_focus);
 }