diff options
author | Kristian Rietveld <kris@gtk.org> | 2002-08-22 00:03:32 +0000 |
---|---|---|
committer | Mikael Hallendal <hallski@src.gnome.org> | 2002-08-22 00:03:32 +0000 |
commit | c34ee45922bb27e9abdf2ee913424094a55bd91b (patch) | |
tree | 258cdc3fb655197c35de5e534811402518ea6d3a | |
parent | dc251cc2eb0368ff4f0783a2f57b28e10341d747 (diff) | |
download | yelp-c34ee45922bb27e9abdf2ee913424094a55bd91b.tar.gz |
also free the node itself (yelp_man_cleaup_initial_tree): free the initial
2002-08-22 Kristian Rietveld <kris@gtk.org>
* src/yelp-man.c:
(yelp_man_free_initial_tree): also free the node itself
(yelp_man_cleaup_initial_tree): free the initial tree structure of
the nodes we're freeing here.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/yelp-man.c | 24 | ||||
-rw-r--r-- | src/yelp-reader.c | 16 |
3 files changed, 28 insertions, 19 deletions
@@ -1,3 +1,10 @@ +2002-08-22 Kristian Rietveld <kris@gtk.org> + + * src/yelp-man.c: + (yelp_man_free_initial_tree): also free the node itself + (yelp_man_cleaup_initial_tree): free the initial tree structure of + the nodes we're freeing here. + 2002-08-21 Mikael Hallendal <micke@codefactory.se> * src/yelp-html-gtkhtml2.c (html_url_requested_cb): diff --git a/src/yelp-man.c b/src/yelp-man.c index b232fa8e..04bb6243 100644 --- a/src/yelp-man.c +++ b/src/yelp-man.c @@ -502,6 +502,18 @@ yelp_man_make_initial_tree (struct TreeData *data, } static void +yelp_man_free_initial_tree (struct TreeNode *node) +{ + g_list_foreach (node->tree_nodes, + (GFunc)yelp_man_free_initial_tree, + NULL); + + g_list_free (node->tree_nodes); + g_list_free (node->pages); + g_free (node); +} + +static void yelp_man_cleanup_initial_tree (struct TreeNode *node) { GList *l; @@ -519,6 +531,7 @@ yelp_man_cleanup_initial_tree (struct TreeNode *node) if (child->pages == NULL && child->tree_nodes == NULL) { node->tree_nodes = g_list_remove (node->tree_nodes, child); + yelp_man_free_initial_tree (child); } } @@ -527,17 +540,6 @@ yelp_man_cleanup_initial_tree (struct TreeNode *node) } static void -yelp_man_free_initial_tree (struct TreeNode *node) -{ - g_list_foreach (node->tree_nodes, - (GFunc)yelp_man_free_initial_tree, - NULL); - - g_list_free (node->tree_nodes); - g_list_free (node->pages); -} - -static void yelp_man_push_initial_tree (struct TreeNode *node, GNode *parent) { struct TreeNode *child; diff --git a/src/yelp-reader.c b/src/yelp-reader.c index f87ab6b9..d2160f29 100644 --- a/src/yelp-reader.c +++ b/src/yelp-reader.c @@ -247,14 +247,14 @@ reader_convert_start (ReaderThreadData *th_data) if (yelp_uri_get_section (uri)) { command_line = g_strdup_printf ("%s %s?%s", - LIBGNOME_INFO2HTML, - yelp_uri_get_path (uri), - yelp_uri_get_section (uri)); + LIBGNOME_INFO2HTML, + yelp_uri_get_path (uri), + yelp_uri_get_section (uri)); } else { command_line = g_strdup_printf ("%s %s", - LIBGNOME_INFO2HTML, - yelp_uri_get_path (uri)); + LIBGNOME_INFO2HTML, + yelp_uri_get_path (uri)); } break; @@ -276,7 +276,7 @@ reader_convert_start (ReaderThreadData *th_data) q_data = reader_q_data_new (reader, priv->stamp, READER_QUEUE_TYPE_DATA); - + g_spawn_command_line_sync (command_line, &q_data->data, NULL, @@ -371,7 +371,7 @@ reader_file_start (ReaderThreadData *th_data) STAMP_MUTEX_UNLOCK; result = gnome_vfs_open (&handle, - yelp_uri_get_path (uri), + yelp_uri_get_path (uri), GNOME_VFS_OPEN_READ); if (result != GNOME_VFS_OK) { @@ -404,7 +404,7 @@ reader_file_start (ReaderThreadData *th_data) STAMP_MUTEX_UNLOCK; } - + q_data = reader_q_data_new (reader, stamp, READER_QUEUE_TYPE_FINISHED); g_async_queue_push (priv->thread_queue, q_data); |