summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher James Halse Rogers <chris@Burninator.(none)>2007-06-25 16:54:31 +1000
committerChristopher James Halse Rogers <chris@Burninator.(none)>2007-06-25 16:54:31 +1000
commitfdc717ce97c4dc9bb5a54d5a21618b8e7dffe7fc (patch)
tree47320e4090be5190c39ed9f9635c051dc57582ac
parent148ce781baa3798014e18bf05c65ed501a893ab3 (diff)
downloadradial-switcher-fdc717ce97c4dc9bb5a54d5a21618b8e7dffe7fc.tar.gz
radial-switcher-fdc717ce97c4dc9bb5a54d5a21618b8e7dffe7fc.tar.bz2
Clean up after our tests.
Fix destroyWindowTree so it doesn't segfault
-rw-r--r--src/switcher-util.c4
-rw-r--r--tests/check_switcher-util.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/switcher-util.c b/src/switcher-util.c
index 2cf6d10..f2d6e4f 100644
--- a/src/switcher-util.c
+++ b/src/switcher-util.c
@@ -100,11 +100,11 @@ newWindowTree (void)
void
destroyWindowTree (WindowTree *node)
{
- destroyWindowList (node->windows);
- for (int i = 0; i < node->childrenSize; ++i)
+ for (int i = 0; i < node->windows->nWindows; ++i)
{
destroyWindowTree (node->children[i]);
}
+ destroyWindowList (node->windows);
free (node->children);
free (node);
}
diff --git a/tests/check_switcher-util.c b/tests/check_switcher-util.c
index 2fbe0dd..e3fe59c 100644
--- a/tests/check_switcher-util.c
+++ b/tests/check_switcher-util.c
@@ -23,6 +23,8 @@ void setup ()
void teardown ()
{
+ destroyWindowList (list);
+ destroyWindowTree (tree);
}
static Bool testCompare (CompWindow *a, CompWindow *b)