[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r1733 - gnunet-gtk/src/plugins/fs
From: |
grothoff |
Subject: |
[GNUnet-SVN] r1733 - gnunet-gtk/src/plugins/fs |
Date: |
Wed, 17 Aug 2005 23:44:36 -0700 (PDT) |
Author: grothoff
Date: 2005-08-17 23:44:35 -0700 (Wed, 17 Aug 2005)
New Revision: 1733
Modified:
gnunet-gtk/src/plugins/fs/download.c
gnunet-gtk/src/plugins/fs/search.c
Log:
cleanup
Modified: gnunet-gtk/src/plugins/fs/download.c
===================================================================
--- gnunet-gtk/src/plugins/fs/download.c 2005-08-18 06:26:31 UTC (rev
1732)
+++ gnunet-gtk/src/plugins/fs/download.c 2005-08-18 06:44:35 UTC (rev
1733)
@@ -534,7 +534,6 @@
void fs_download_stop() {
GtkTreeIter iter;
struct ECRS_URI * u;
- struct ECRS_MetaData * m;
DownloadList * pos;
/* free URIs in summary model */
@@ -559,26 +558,6 @@
ECRS_freeUri(head->uri);
FREE(head->filename);
gtk_tree_row_reference_free(head->rr);
- if (gtk_tree_model_get_iter_first(head->model,
- &iter)) {
- do {
- gtk_tree_model_get(head->model,
- &iter,
- SEARCH_URI, &u,
- SEARCH_META, &m,
- -1);
- gtk_tree_store_set(GTK_TREE_STORE(head->model),
- &iter,
- SEARCH_URI, NULL,
- SEARCH_META, NULL,
- -1);
- if (u != NULL)
- ECRS_freeUri(u);
- if (m != NULL)
- ECRS_freeMetaData(m);
- } while (gtk_tree_model_iter_next(head->model,
- &iter));
- }
FREE(head);
head = pos;
}
Modified: gnunet-gtk/src/plugins/fs/search.c
===================================================================
--- gnunet-gtk/src/plugins/fs/search.c 2005-08-18 06:26:31 UTC (rev 1732)
+++ gnunet-gtk/src/plugins/fs/search.c 2005-08-18 06:44:35 UTC (rev 1733)
@@ -790,6 +790,8 @@
void fs_search_stop() {
SearchList * list;
+ GtkTreeIter iter;
+ struct ECRS_URI * u;
delCronJob(&updateNCBModel,
5 * cronMINUTES,
@@ -798,9 +800,57 @@
list = head;
head = head->next;
ECRS_freeUri(list->uri);
+
+#if 0
+ /* FIXME - memory leak. The following is still incorrect:
+ a) does not free entire tree (need to recurse!)
+ b) needs to be invoked earlier; the model
+ may have already gone bye-bye at this point!
+ (idea: bind code to destroy signal from
+ searchPage!)
+ */
+ if (gtk_tree_model_get_iter_first(head->model,
+ &iter)) {
+ struct ECRS_MetaData * m;
+ do {
+ gtk_tree_model_get(head->model,
+ &iter,
+ SEARCH_URI, &u,
+ SEARCH_META, &m,
+ -1);
+ gtk_tree_store_set(GTK_TREE_STORE(head->model),
+ &iter,
+ SEARCH_URI, NULL,
+ SEARCH_META, NULL,
+ -1);
+ if (u != NULL)
+ ECRS_freeUri(u);
+ if (m != NULL)
+ ECRS_freeMetaData(m);
+ } while (gtk_tree_model_iter_next(head->model,
+ &iter));
+ }
+#endif
FREE(list);
}
-
+
+ /* free URIs in summary */
+ if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(summary),
+ &iter)) {
+ do {
+ gtk_tree_model_get(GTK_TREE_MODEL(summary),
+ &iter,
+ SER_SUM_URI, &u,
+ -1);
+ if (u != NULL)
+ ECRS_freeUri(u);
+ gtk_list_store_set(summary,
+ &iter,
+ SER_SUM_URI, NULL,
+ -1);
+ } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(summary),
+ &iter));
+ }
}
/* end of search.c */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r1733 - gnunet-gtk/src/plugins/fs,
grothoff <=