diff options
author | Christian Grothoff <christian@grothoff.org> | 2005-08-22 03:09:48 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2005-08-22 03:09:48 +0000 |
commit | 1c8f7937612f37bc7454b335468515df63cc9289 (patch) | |
tree | 828a5f58c2a3cf29a77085acb3ef8e05cf5a8d6b | |
parent | 1081903401f9abb910909c1bcd98b224b62863f7 (diff) | |
download | gnunet-gtk-1c8f7937612f37bc7454b335468515df63cc9289.tar.gz gnunet-gtk-1c8f7937612f37bc7454b335468515df63cc9289.zip |
fix
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/plugins/fs/download.c | 34 |
2 files changed, 21 insertions, 16 deletions
@@ -1,3 +1,6 @@ | |||
1 | Sun Aug 21 19:57:19 PDT 2005 | ||
2 | Fixed deadlock in download abort code. | ||
3 | |||
1 | Sun Aug 21 18:42:14 PDT 2005 | 4 | Sun Aug 21 18:42:14 PDT 2005 |
2 | Fixed deadlock in gnunet-gtk shutdown. | 5 | Fixed deadlock in gnunet-gtk shutdown. |
3 | 6 | ||
diff --git a/src/plugins/fs/download.c b/src/plugins/fs/download.c index 5abbd3ae..ed2de800 100644 --- a/src/plugins/fs/download.c +++ b/src/plugins/fs/download.c | |||
@@ -413,25 +413,16 @@ void on_clearCompletedDownloadsButton_clicked(void * unused, | |||
413 | NULL); | 413 | NULL); |
414 | } | 414 | } |
415 | 415 | ||
416 | static void * shutdownCode(void * it) { | 416 | struct aDC_closure { |
417 | GtkTreeModel * model; | ||
418 | GtkTreeIter * iter = it; | ||
419 | struct ECRS_URI * u; | 417 | struct ECRS_URI * u; |
420 | char * fn; | 418 | char * fn; |
419 | }; | ||
421 | 420 | ||
422 | model = GTK_TREE_MODEL(summary); | 421 | static void * shutdownCode(void * c) { |
423 | gtk_tree_model_get(model, | 422 | struct aDC_closure * cls = c; |
424 | iter, | ||
425 | DOWNLOAD_URI, &u, | ||
426 | DOWNLOAD_FILENAME, &fn, | ||
427 | -1); | ||
428 | FSUI_stopDownload(ctx, | 423 | FSUI_stopDownload(ctx, |
429 | u, | 424 | cls->u, |
430 | fn); | 425 | cls->fn); |
431 | gtk_tree_store_remove(summary, | ||
432 | iter); | ||
433 | if (u != NULL) | ||
434 | ECRS_freeUri(u); | ||
435 | return NULL; | 426 | return NULL; |
436 | } | 427 | } |
437 | 428 | ||
@@ -439,9 +430,20 @@ static void abortDownloadCallback(GtkTreeModel * model, | |||
439 | GtkTreePath * path, | 430 | GtkTreePath * path, |
440 | GtkTreeIter * iter, | 431 | GtkTreeIter * iter, |
441 | GtkTreeStore * tree) { | 432 | GtkTreeStore * tree) { |
433 | struct aDC_closure cls; | ||
434 | |||
442 | GNUNET_ASSERT(model == GTK_TREE_MODEL(summary)); | 435 | GNUNET_ASSERT(model == GTK_TREE_MODEL(summary)); |
436 | gtk_tree_model_get(model, | ||
437 | iter, | ||
438 | DOWNLOAD_URI, &cls.u, | ||
439 | DOWNLOAD_FILENAME, &cls.fn, | ||
440 | -1); | ||
441 | gtk_tree_store_remove(summary, | ||
442 | iter); | ||
443 | run_with_save_calls(&shutdownCode, | 443 | run_with_save_calls(&shutdownCode, |
444 | iter); | 444 | &cls); |
445 | if (cls.u != NULL) | ||
446 | ECRS_freeUri(cls.u); | ||
445 | } | 447 | } |
446 | 448 | ||
447 | void on_abortDownloadButton_clicked(void * unused, | 449 | void on_abortDownloadButton_clicked(void * unused, |