mirror of https://github.com/Icinga/icinga2.git
Fixed crash while unloading auth/sub components.
This commit is contained in:
parent
fb53dd345c
commit
5ae2c4aa5b
|
@ -25,12 +25,17 @@ void AuthenticationComponent::Start(void)
|
|||
|
||||
void AuthenticationComponent::Stop(void)
|
||||
{
|
||||
IcingaApplication::Ptr app = GetIcingaApplication();
|
||||
|
||||
if (app) {
|
||||
EndpointManager::Ptr mgr = app->GetEndpointManager();
|
||||
mgr->UnregisterEndpoint(m_AuthenticationEndpoint);
|
||||
}
|
||||
}
|
||||
|
||||
int AuthenticationComponent::NewEndpointHandler(const NewEndpointEventArgs& neea)
|
||||
{
|
||||
if (neea.Endpoint->IsLocal())
|
||||
if (neea.Endpoint->IsLocal() || neea.Endpoint->HasIdentity())
|
||||
return 0;
|
||||
|
||||
JsonRpcRequest request;
|
||||
|
@ -42,6 +47,8 @@ int AuthenticationComponent::NewEndpointHandler(const NewEndpointEventArgs& neea
|
|||
request.SetParams(params);
|
||||
|
||||
neea.Endpoint->ProcessRequest(m_AuthenticationEndpoint, request);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AuthenticationComponent::IdentityMessageHandler(const NewRequestEventArgs& nrea)
|
||||
|
|
|
@ -29,9 +29,13 @@ void SubscriptionComponent::Start(void)
|
|||
|
||||
void SubscriptionComponent::Stop(void)
|
||||
{
|
||||
EndpointManager::Ptr mgr = GetIcingaApplication()->GetEndpointManager();
|
||||
IcingaApplication::Ptr app = GetIcingaApplication();
|
||||
|
||||
if (app) {
|
||||
EndpointManager::Ptr mgr = app->GetEndpointManager();
|
||||
mgr->UnregisterEndpoint(m_SubscriptionEndpoint);
|
||||
}
|
||||
}
|
||||
|
||||
int SubscriptionComponent::SyncSubscription(Endpoint::Ptr target, string type, const NewMethodEventArgs& nmea)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue