Added a dedicated sender flush method, delay sender destruction until users gone
[strongswan.git] / src / libcharon / daemon.c
index 3fb49d4..f2c054a 100644 (file)
@@ -109,8 +109,11 @@ static void destroy(private_daemon_t *this)
        {
                this->public.traps->flush(this->public.traps);
        }
+       if (this->public.sender)
+       {
+               this->public.sender->flush(this->public.sender);
+       }
        DESTROY_IF(this->public.receiver);
-       DESTROY_IF(this->public.sender);
 #ifdef ME
        DESTROY_IF(this->public.connect_manager);
        DESTROY_IF(this->public.mediation_manager);
@@ -129,6 +132,7 @@ static void destroy(private_daemon_t *this)
        DESTROY_IF(this->public.controller);
        DESTROY_IF(this->public.eap);
        DESTROY_IF(this->public.backends);
+       DESTROY_IF(this->public.sender);
        DESTROY_IF(this->public.socket);
 
        /* rehook library logging, shutdown logging */