diff options
author | Christian Grothoff <christian@grothoff.org> | 2005-08-18 06:44:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2005-08-18 06:44:35 +0000 |
commit | 1f7214809fcbe6d1098aa4e251de233190645357 (patch) | |
tree | 64dea331b22ab0f7c0818286a2ab00c5c01b286f | |
parent | d2c6d0251c1161da66345924a6c69b6db920ec79 (diff) | |
download | gnunet-gtk-1f7214809fcbe6d1098aa4e251de233190645357.tar.gz gnunet-gtk-1f7214809fcbe6d1098aa4e251de233190645357.zip |
cleanup
-rw-r--r-- | src/plugins/fs/download.c | 21 | ||||
-rw-r--r-- | src/plugins/fs/search.c | 52 |
2 files changed, 51 insertions, 22 deletions
diff --git a/src/plugins/fs/download.c b/src/plugins/fs/download.c index ab03525a..9e09571f 100644 --- a/src/plugins/fs/download.c +++ b/src/plugins/fs/download.c | |||
@@ -534,7 +534,6 @@ void fs_download_start() { | |||
534 | void fs_download_stop() { | 534 | void fs_download_stop() { |
535 | GtkTreeIter iter; | 535 | GtkTreeIter iter; |
536 | struct ECRS_URI * u; | 536 | struct ECRS_URI * u; |
537 | struct ECRS_MetaData * m; | ||
538 | DownloadList * pos; | 537 | DownloadList * pos; |
539 | 538 | ||
540 | /* free URIs in summary model */ | 539 | /* free URIs in summary model */ |
@@ -559,26 +558,6 @@ void fs_download_stop() { | |||
559 | ECRS_freeUri(head->uri); | 558 | ECRS_freeUri(head->uri); |
560 | FREE(head->filename); | 559 | FREE(head->filename); |
561 | gtk_tree_row_reference_free(head->rr); | 560 | gtk_tree_row_reference_free(head->rr); |
562 | if (gtk_tree_model_get_iter_first(head->model, | ||
563 | &iter)) { | ||
564 | do { | ||
565 | gtk_tree_model_get(head->model, | ||
566 | &iter, | ||
567 | SEARCH_URI, &u, | ||
568 | SEARCH_META, &m, | ||
569 | -1); | ||
570 | gtk_tree_store_set(GTK_TREE_STORE(head->model), | ||
571 | &iter, | ||
572 | SEARCH_URI, NULL, | ||
573 | SEARCH_META, NULL, | ||
574 | -1); | ||
575 | if (u != NULL) | ||
576 | ECRS_freeUri(u); | ||
577 | if (m != NULL) | ||
578 | ECRS_freeMetaData(m); | ||
579 | } while (gtk_tree_model_iter_next(head->model, | ||
580 | &iter)); | ||
581 | } | ||
582 | FREE(head); | 561 | FREE(head); |
583 | head = pos; | 562 | head = pos; |
584 | } | 563 | } |
diff --git a/src/plugins/fs/search.c b/src/plugins/fs/search.c index aae676e3..1d21bb72 100644 --- a/src/plugins/fs/search.c +++ b/src/plugins/fs/search.c | |||
@@ -790,6 +790,8 @@ void fs_search_start() { | |||
790 | 790 | ||
791 | void fs_search_stop() { | 791 | void fs_search_stop() { |
792 | SearchList * list; | 792 | SearchList * list; |
793 | GtkTreeIter iter; | ||
794 | struct ECRS_URI * u; | ||
793 | 795 | ||
794 | delCronJob(&updateNCBModel, | 796 | delCronJob(&updateNCBModel, |
795 | 5 * cronMINUTES, | 797 | 5 * cronMINUTES, |
@@ -798,9 +800,57 @@ void fs_search_stop() { | |||
798 | list = head; | 800 | list = head; |
799 | head = head->next; | 801 | head = head->next; |
800 | ECRS_freeUri(list->uri); | 802 | ECRS_freeUri(list->uri); |
803 | |||
804 | #if 0 | ||
805 | /* FIXME - memory leak. The following is still incorrect: | ||
806 | a) does not free entire tree (need to recurse!) | ||
807 | b) needs to be invoked earlier; the model | ||
808 | may have already gone bye-bye at this point! | ||
809 | (idea: bind code to destroy signal from | ||
810 | searchPage!) | ||
811 | */ | ||
812 | if (gtk_tree_model_get_iter_first(head->model, | ||
813 | &iter)) { | ||
814 | struct ECRS_MetaData * m; | ||
815 | do { | ||
816 | gtk_tree_model_get(head->model, | ||
817 | &iter, | ||
818 | SEARCH_URI, &u, | ||
819 | SEARCH_META, &m, | ||
820 | -1); | ||
821 | gtk_tree_store_set(GTK_TREE_STORE(head->model), | ||
822 | &iter, | ||
823 | SEARCH_URI, NULL, | ||
824 | SEARCH_META, NULL, | ||
825 | -1); | ||
826 | if (u != NULL) | ||
827 | ECRS_freeUri(u); | ||
828 | if (m != NULL) | ||
829 | ECRS_freeMetaData(m); | ||
830 | } while (gtk_tree_model_iter_next(head->model, | ||
831 | &iter)); | ||
832 | } | ||
833 | #endif | ||
801 | FREE(list); | 834 | FREE(list); |
802 | } | 835 | } |
803 | 836 | ||
837 | /* free URIs in summary */ | ||
838 | if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(summary), | ||
839 | &iter)) { | ||
840 | do { | ||
841 | gtk_tree_model_get(GTK_TREE_MODEL(summary), | ||
842 | &iter, | ||
843 | SER_SUM_URI, &u, | ||
844 | -1); | ||
845 | if (u != NULL) | ||
846 | ECRS_freeUri(u); | ||
847 | gtk_list_store_set(summary, | ||
848 | &iter, | ||
849 | SER_SUM_URI, NULL, | ||
850 | -1); | ||
851 | } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(summary), | ||
852 | &iter)); | ||
853 | } | ||
804 | } | 854 | } |
805 | 855 | ||
806 | /* end of search.c */ | 856 | /* end of search.c */ |