aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/daemon.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2015-03-05 10:08:33 +0100
committerTobias Brunner <tobias@strongswan.org>2015-03-09 15:58:06 +0100
commit69bb1b8c1885c8d12cd2d8e0ca133bb9a2487ef8 (patch)
tree1826aab23bbf547173e40fa532a7c4b94ad26394 /src/libcharon/daemon.c
parent11ac1dff9c00c95b19fbe074ba788fc278970678 (diff)
downloadstrongswan-69bb1b8c1885c8d12cd2d8e0ca133bb9a2487ef8.tar.bz2
strongswan-69bb1b8c1885c8d12cd2d8e0ca133bb9a2487ef8.tar.xz
daemon: Remove scheduled jobs before unloading plugins
Especially callback jobs might refer to memory that gets invalid after the plugins got unlaoded, so make sure we destroy these jobs before. References #840.
Diffstat (limited to 'src/libcharon/daemon.c')
-rw-r--r--src/libcharon/daemon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcharon/daemon.c b/src/libcharon/daemon.c
index d44cb37eb..b1b8f57f0 100644
--- a/src/libcharon/daemon.c
+++ b/src/libcharon/daemon.c
@@ -474,8 +474,9 @@ static void destroy(private_daemon_t *this)
DESTROY_IF(this->public.connect_manager);
DESTROY_IF(this->public.mediation_manager);
#endif /* ME */
- /* make sure the cache is clear before unloading plugins */
+ /* make sure the cache and scheduler are clear before unloading plugins */
lib->credmgr->flush_cache(lib->credmgr, CERT_ANY);
+ lib->scheduler->flush(lib->scheduler);
lib->plugins->unload(lib->plugins);
DESTROY_IF(this->public.attributes);
DESTROY_IF(this->kernel_handler);