diff options
author | Martin Willi <martin@strongswan.org> | 2008-07-04 14:21:41 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2008-07-04 14:21:41 +0000 |
commit | ca275ae2ca58fd645fb5e26684ee1df2f8770a19 (patch) | |
tree | f888bc294d5369a38dfaaaef9bff77133bd594a9 /src/dumm/dumm.c | |
parent | 4302d4f0120cebe54c90ae7ecf55a90f641eb105 (diff) | |
download | strongswan-ca275ae2ca58fd645fb5e26684ee1df2f8770a19.tar.bz2 strongswan-ca275ae2ca58fd645fb5e26684ee1df2f8770a19.tar.xz |
prototype of irdumm - interactive ruby shell for dumm
Diffstat (limited to 'src/dumm/dumm.c')
-rw-r--r-- | src/dumm/dumm.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/dumm/dumm.c b/src/dumm/dumm.c index 5db8eaee0..0bb74e886 100644 --- a/src/dumm/dumm.c +++ b/src/dumm/dumm.c @@ -49,8 +49,6 @@ struct private_dumm_t { linked_list_t *guests; /** list of managed bridges */ linked_list_t *bridges; - /** do not catch signals if we are destroying */ - bool destroying; }; /** @@ -219,8 +217,11 @@ static void destroy(private_dumm_t *this) } enumerator->destroy(enumerator); - this->destroying = TRUE; - this->guests->destroy_offset(this->guests, offsetof(guest_t, destroy)); + while (this->guests->remove_last(this->guests, (void**)&guest) == SUCCESS) + { + guest->destroy(guest); + } + this->guests->destroy(this->guests); free(this->guest_dir); free(this->template_dir); free(this->template); @@ -279,8 +280,6 @@ dumm_t *dumm_create(char *dir) this->public.load_template = (bool(*)(dumm_t*, char *name))load_template; this->public.destroy = (void(*)(dumm_t*))destroy; - this->destroying = FALSE; - if (dir && *dir == '/') { this->dir = strdup(dir); |