Tiling2: Fixed buy with deleting last vertical split.
authorTom Hacohen <tom@stosb.com>
Tue, 14 Jan 2014 14:53:45 +0000 (14:53 +0000)
committerTom Hacohen <tom@stosb.com>
Fri, 21 Feb 2014 09:15:06 +0000 (09:15 +0000)
src/modules/tiling/window_tree.c

index 62fe285..dc2b2fa 100644 (file)
@@ -155,7 +155,14 @@ tiling_window_tree_remove(Window_Tree *root, Window_Tree *item)
                 break;
           }
 
-        if (!item_keep->children)
+        if (!item_keep)
+          {
+             /* Special case of deleting the last vertical split item. */
+             free(item);
+             free(root);
+             return NULL;
+          }
+        else if (!item_keep->children)
           {
              parent->client = item_keep->client;
              parent->children = NULL;