newSession and endSession work

This commit is contained in:
Andreas Steffen
2011-08-10 09:29:33 +02:00
parent c77af76807
commit 7ab854adf9
2 changed files with 90 additions and 26 deletions
@@ -45,8 +45,11 @@ METHOD(plugin_t, get_name, char*,
METHOD(plugin_t, destroy, void,
private_tnc_ifmap_plugin_t *this)
{
charon->bus->remove_listener(charon->bus, &this->listener->listener);
this->listener->destroy(this->listener);
if (this->listener)
{
charon->bus->remove_listener(charon->bus, &this->listener->listener);
this->listener->destroy(this->listener);
}
free(this);
}
@@ -68,8 +71,10 @@ plugin_t *tnc_ifmap_plugin_create()
.listener = tnc_ifmap_listener_create(),
);
charon->bus->add_listener(charon->bus, &this->listener->listener);
if (this->listener)
{
charon->bus->add_listener(charon->bus, &this->listener->listener);
}
return &this->public.plugin;
}