initialize libstrongswan in dynamic stand-alone libimcv-based libraries
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
#include "imcv.h"
|
||||
#include "imc_agent.h"
|
||||
|
||||
#include <debug.h>
|
||||
@@ -277,6 +278,9 @@ METHOD(imc_agent_t, destroy, void,
|
||||
this->connections->destroy_function(this->connections, free);
|
||||
this->connection_lock->destroy(this->connection_lock);
|
||||
free(this);
|
||||
|
||||
/* decrease the reference count or terminate */
|
||||
libimcv_deinit();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -288,6 +292,12 @@ imc_agent_t *imc_agent_create(const char *name,
|
||||
{
|
||||
private_imc_agent_t *this;
|
||||
|
||||
/* initialize or increase the reference count */
|
||||
if (!libimcv_init())
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
INIT(this,
|
||||
.public = {
|
||||
.bind_functions = _bind_functions,
|
||||
|
||||
Reference in New Issue
Block a user