diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-02-28 20:24:24 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-02-28 20:24:24 +0100 |
commit | 4bf1d97b60faba3b75e0964678b3834bd859475f (patch) | |
tree | 2546bebaac685ed2887f490935461e3379b85b8d /src/set/set_api.c | |
parent | 90f6407e2ed835241c29bbd8c57bac47dd76e59c (diff) | |
download | gnunet-4bf1d97b60faba3b75e0964678b3834bd859475f.tar.gz gnunet-4bf1d97b60faba3b75e0964678b3834bd859475f.zip |
allow destruction while iteration is active
Diffstat (limited to 'src/set/set_api.c')
-rw-r--r-- | src/set/set_api.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/set/set_api.c b/src/set/set_api.c index 5b5b1b8ee..04a4e4910 100644 --- a/src/set/set_api.c +++ b/src/set/set_api.c | |||
@@ -349,6 +349,9 @@ handle_iter_done (void *cls, | |||
349 | set->iteration_id++; | 349 | set->iteration_id++; |
350 | iter (set->iterator_cls, | 350 | iter (set->iterator_cls, |
351 | NULL); | 351 | NULL); |
352 | |||
353 | if (GNUNET_YES == set->destroy_requested) | ||
354 | GNUNET_SET_destroy (set); | ||
352 | } | 355 | } |
353 | 356 | ||
354 | 357 | ||
@@ -733,8 +736,7 @@ GNUNET_SET_destroy (struct GNUNET_SET_Handle *set) | |||
733 | /* destroying set while iterator is active is currently | 736 | /* destroying set while iterator is active is currently |
734 | not supported; we should expand the API to allow | 737 | not supported; we should expand the API to allow |
735 | clients to explicitly cancel the iteration! */ | 738 | clients to explicitly cancel the iteration! */ |
736 | GNUNET_assert (NULL == set->iterator); | 739 | if ( (NULL != set->ops_head) || (NULL != set->iterator) ) |
737 | if (NULL != set->ops_head) | ||
738 | { | 740 | { |
739 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 741 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
740 | "Set operations are pending, delaying set destruction\n"); | 742 | "Set operations are pending, delaying set destruction\n"); |