aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'Source/charon/daemon.c')
-rw-r--r--Source/charon/daemon.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/charon/daemon.c b/Source/charon/daemon.c
index d1e0c13c2..be9900757 100644
--- a/Source/charon/daemon.c
+++ b/Source/charon/daemon.c
@@ -179,6 +179,7 @@ static void initialize(private_daemon_t *this)
this->public.sender = sender_create();
this->public.receiver = receiver_create();
this->public.scheduler = scheduler_create();
+ this->public.prime_pool = prime_pool_create(0);
this->public.thread_pool = thread_pool_create(NUMBER_OF_WORKING_THREADS);
}
@@ -203,6 +204,10 @@ static void destroy(private_daemon_t *this)
{
this->public.thread_pool->destroy(this->public.thread_pool);
}
+ if (this->public.prime_pool != NULL)
+ {
+ this->public.prime_pool->destroy(this->public.prime_pool);
+ }
if (this->public.job_queue != NULL)
{
this->public.job_queue->destroy(this->public.job_queue);
@@ -240,7 +245,7 @@ static void destroy(private_daemon_t *this)
* @return created daemon_t
*/
private_daemon_t *daemon_create()
-{
+{
private_daemon_t *this = allocator_alloc_thing(private_daemon_t);
/* assign methods */
@@ -285,6 +290,9 @@ int main(int argc, char *argv[])
{
private_daemon_t *private_charon;
+ /* allocation needs initialization, before any allocs are done */
+ allocator_init();
+
private_charon = daemon_create();
charon = (daemon_t*)private_charon;