diff options
author | Christian Grothoff <christian@grothoff.org> | 2005-08-18 04:33:52 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2005-08-18 04:33:52 +0000 |
commit | cdeeaedbca63cbc5f3d030f09963f8056c6e5e67 (patch) | |
tree | f639ed7e65ece7eba418835d9aefa3467da79ddc | |
parent | 43599573ecbbcfa0eec9af6b8c32999001fe07f8 (diff) | |
download | gnunet-gtk-cdeeaedbca63cbc5f3d030f09963f8056c6e5e67.tar.gz gnunet-gtk-cdeeaedbca63cbc5f3d030f09963f8056c6e5e67.zip |
fixing memory leaks from 686 and then some
-rw-r--r-- | src/plugins/fs/collection.c | 1 | ||||
-rw-r--r-- | src/plugins/fs/download.c | 33 | ||||
-rw-r--r-- | src/plugins/fs/namespace.c | 34 |
3 files changed, 64 insertions, 4 deletions
diff --git a/src/plugins/fs/collection.c b/src/plugins/fs/collection.c index 81aa9791..821f0213 100644 --- a/src/plugins/fs/collection.c +++ b/src/plugins/fs/collection.c | |||
@@ -173,6 +173,7 @@ void fs_collection_start() { | |||
173 | } | 173 | } |
174 | 174 | ||
175 | void fs_collection_stop() { | 175 | void fs_collection_stop() { |
176 | /* nothing to do */ | ||
176 | } | 177 | } |
177 | 178 | ||
178 | /* end of collection.c */ | 179 | /* end of collection.c */ |
diff --git a/src/plugins/fs/download.c b/src/plugins/fs/download.c index 0b3954d8..f627dfb1 100644 --- a/src/plugins/fs/download.c +++ b/src/plugins/fs/download.c | |||
@@ -497,10 +497,11 @@ void fs_download_start() { | |||
497 | } | 497 | } |
498 | 498 | ||
499 | 499 | ||
500 | |||
501 | void fs_download_stop() { | 500 | void fs_download_stop() { |
502 | GtkTreeIter iter; | 501 | GtkTreeIter iter; |
503 | struct ECRS_URI * u; | 502 | struct ECRS_URI * u; |
503 | struct ECRS_MetaData * m; | ||
504 | DownloadList * pos; | ||
504 | 505 | ||
505 | /* free URIs in summary model */ | 506 | /* free URIs in summary model */ |
506 | if (! gtk_tree_model_get_iter_first(GTK_TREE_MODEL(summary), | 507 | if (! gtk_tree_model_get_iter_first(GTK_TREE_MODEL(summary), |
@@ -517,10 +518,36 @@ void fs_download_stop() { | |||
517 | -1); | 518 | -1); |
518 | if (u != NULL) | 519 | if (u != NULL) |
519 | ECRS_freeUri(u); | 520 | ECRS_freeUri(u); |
520 | /* FIXME: | ||
521 | also free DOWNLOAD_TREEPATH! */ | ||
522 | } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(summary), | 521 | } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(summary), |
523 | &iter)); | 522 | &iter)); |
523 | while (head != NULL) { | ||
524 | pos = head->next; | ||
525 | ECRS_freeUri(head->uri); | ||
526 | FREE(head->filename); | ||
527 | gtk_tree_row_reference_free(head->rr); | ||
528 | if (gtk_tree_model_get_iter_first(head->model, | ||
529 | &iter)) { | ||
530 | do { | ||
531 | gtk_tree_model_get(head->model, | ||
532 | &iter, | ||
533 | SEARCH_URI, &u, | ||
534 | SEARCH_META, &m, | ||
535 | -1); | ||
536 | gtk_tree_store_set(GTK_TREE_STORE(head->model), | ||
537 | &iter, | ||
538 | SEARCH_URI, NULL, | ||
539 | SEARCH_META, NULL, | ||
540 | -1); | ||
541 | if (u != NULL) | ||
542 | ECRS_freeUri(u); | ||
543 | if (m != NULL) | ||
544 | ECRS_freeMetaData(m); | ||
545 | } while (gtk_tree_model_iter_next(head->model, | ||
546 | &iter)); | ||
547 | } | ||
548 | FREE(head); | ||
549 | head = pos; | ||
550 | } | ||
524 | } | 551 | } |
525 | 552 | ||
526 | 553 | ||
diff --git a/src/plugins/fs/namespace.c b/src/plugins/fs/namespace.c index 468d9a86..564a9fe6 100644 --- a/src/plugins/fs/namespace.c +++ b/src/plugins/fs/namespace.c | |||
@@ -868,7 +868,39 @@ void fs_namespace_start() { | |||
868 | } | 868 | } |
869 | 869 | ||
870 | void fs_namespace_stop() { | 870 | void fs_namespace_stop() { |
871 | /* FIXME: free memory! */ | 871 | NamespaceList * pos; |
872 | GtkTreeIter iter; | ||
873 | struct ECRS_URI * u; | ||
874 | struct ECRS_MetaData * m; | ||
875 | |||
876 | while (head != NULL) { | ||
877 | pos = head->next; | ||
878 | FREE(head->name); | ||
879 | ECRS_freeMetaData(head->meta); | ||
880 | |||
881 | if (gtk_tree_model_get_iter_first(head->model, | ||
882 | &iter)) { | ||
883 | do { | ||
884 | gtk_tree_model_get(head->model, | ||
885 | &iter, | ||
886 | IN_NAMESPACE_URI, &u, | ||
887 | IN_NAMESPACE_META, &m, | ||
888 | -1); | ||
889 | gtk_list_store_set(GTK_LIST_STORE(head->model), | ||
890 | &iter, | ||
891 | IN_NAMESPACE_URI, NULL, | ||
892 | IN_NAMESPACE_META, NULL, | ||
893 | -1); | ||
894 | if (u != NULL) | ||
895 | ECRS_freeUri(u); | ||
896 | if (m != NULL) | ||
897 | ECRS_freeMetaData(m); | ||
898 | } while (gtk_tree_model_iter_next(head->model, | ||
899 | &iter)); | ||
900 | } | ||
901 | FREE(head); | ||
902 | head = pos; | ||
903 | } | ||
872 | 904 | ||
873 | delCronJob(&updateContentList, | 905 | delCronJob(&updateContentList, |
874 | 5 * cronMINUTES, | 906 | 5 * cronMINUTES, |