diff options
Diffstat (limited to 'src/plugins/fs/search.c')
-rw-r--r-- | src/plugins/fs/search.c | 52 |
1 files changed, 51 insertions, 1 deletions
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 */ |