summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2017-09-18 22:32:36 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2017-09-18 22:32:36 (GMT)
commit3b1992d3f4877ca5b543ecda1f242f6e6b12a016 (patch)
tree6d8adfc4a756788be21814a903b4d175af7fb089
parentec4b9a5dd008785e6498dcefb025f6234965f529 (diff)
downloadnetsurf-3b1992d3f4877ca5b543ecda1f242f6e6b12a016.tar.gz
netsurf-3b1992d3f4877ca5b543ecda1f242f6e6b12a016.tar.bz2
Treeview: Destroy search first on treeview destruction.
-rw-r--r--desktop/treeview.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 4841db9..01998e1 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -2013,6 +2013,12 @@ nserror treeview_destroy(treeview *tree)
assert(tree != NULL);
+ if (tree->search.textarea != NULL) {
+ tree->search.active = false;
+ tree->search.search = false;
+ textarea_destroy(tree->search.textarea);
+ }
+
/* Destroy nodes */
treeview_delete_node_internal(tree, tree->root, false,
TREE_OPTION_SUPPRESS_RESIZE |
@@ -2024,10 +2030,6 @@ nserror treeview_destroy(treeview *tree)
}
free(tree->fields);
- if (tree->search.textarea != NULL) {
- textarea_destroy(tree->search.textarea);
- }
-
/* Free treeview */
free(tree);