mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 06:25:34 +00:00
[#3449] clean up on destructor
This commit is contained in:
@@ -209,16 +209,7 @@ public:
|
|||||||
fake_received_.push_back(pkt);
|
fake_received_.push_back(pkt);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~NakedDhcpv4Srv() {
|
virtual ~NakedDhcpv4Srv() = default;
|
||||||
// Close the lease database
|
|
||||||
isc::dhcp::LeaseMgrFactory::destroy();
|
|
||||||
|
|
||||||
getIOService()->restart();
|
|
||||||
try {
|
|
||||||
getIOService()->poll();
|
|
||||||
} catch (...) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @brief Runs processing DHCPDISCOVER.
|
/// @brief Runs processing DHCPDISCOVER.
|
||||||
///
|
///
|
||||||
|
@@ -216,11 +216,7 @@ public:
|
|||||||
fake_received_.push_back(pkt);
|
fake_received_.push_back(pkt);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~NakedDhcpv6Srv() {
|
virtual ~NakedDhcpv6Srv() = default;
|
||||||
// Close the lease database
|
|
||||||
isc::dhcp::LeaseMgrFactory::destroy();
|
|
||||||
getIOService()->stopAndPoll();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @brief Processes incoming Solicit message.
|
/// @brief Processes incoming Solicit message.
|
||||||
///
|
///
|
||||||
|
@@ -429,11 +429,8 @@ int load(LibraryHandle& handle) {
|
|||||||
/// @return 0 if deregistration was successful, 1 otherwise
|
/// @return 0 if deregistration was successful, 1 otherwise
|
||||||
int unload() {
|
int unload() {
|
||||||
if (impl) {
|
if (impl) {
|
||||||
IOServicePtr io_service = impl->getIOService();
|
IOServiceMgr::instance().unregisterIOService(impl->getIOService());
|
||||||
IOServiceMgr::instance().unregisterIOService(io_service);
|
|
||||||
io_service->stopAndPoll();
|
|
||||||
impl.reset();
|
impl.reset();
|
||||||
io_service->stopAndPoll();
|
|
||||||
}
|
}
|
||||||
LOG_INFO(ha_logger, HA_DEINIT_OK);
|
LOG_INFO(ha_logger, HA_DEINIT_OK);
|
||||||
return (0);
|
return (0);
|
||||||
|
@@ -66,6 +66,9 @@ HAImpl::~HAImpl() {
|
|||||||
// than relying on destruction order.
|
// than relying on destruction order.
|
||||||
service->stopClientAndListener();
|
service->stopClientAndListener();
|
||||||
}
|
}
|
||||||
|
config_.reset();
|
||||||
|
services_.reset(new HAServiceMapper());
|
||||||
|
io_service_->stopAndPoll();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -245,7 +245,6 @@ protected:
|
|||||||
|
|
||||||
/// @brief Pointer to the high availability services (state machines).
|
/// @brief Pointer to the high availability services (state machines).
|
||||||
HAServiceMapperPtr services_;
|
HAServiceMapperPtr services_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// @brief Pointer to the High Availability hooks library implementation.
|
/// @brief Pointer to the High Availability hooks library implementation.
|
||||||
|
@@ -94,9 +94,11 @@ int unload() {
|
|||||||
// Unregister the factories and remove MySQL backends
|
// Unregister the factories and remove MySQL backends
|
||||||
isc::dhcp::MySqlConfigBackendDHCPv4::unregisterBackendType();
|
isc::dhcp::MySqlConfigBackendDHCPv4::unregisterBackendType();
|
||||||
isc::dhcp::MySqlConfigBackendDHCPv6::unregisterBackendType();
|
isc::dhcp::MySqlConfigBackendDHCPv6::unregisterBackendType();
|
||||||
IOServiceMgr::instance().unregisterIOService(isc::dhcp::MySqlConfigBackendImpl::getIOService());
|
IOServicePtr io_service = isc::dhcp::MySqlConfigBackendImpl::getIOService();
|
||||||
if (isc::dhcp::MySqlConfigBackendImpl::getIOService()) {
|
if (io_service) {
|
||||||
isc::dhcp::MySqlConfigBackendImpl::getIOService()->stopAndPoll();
|
IOServiceMgr::instance().unregisterIOService(io_service);
|
||||||
|
io_service->stopAndPoll();
|
||||||
|
isc::dhcp::MySqlConfigBackendImpl::setIOService(IOServicePtr());
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@@ -94,9 +94,11 @@ int unload() {
|
|||||||
// Unregister the factories and remove PostgreSQL backends
|
// Unregister the factories and remove PostgreSQL backends
|
||||||
isc::dhcp::PgSqlConfigBackendDHCPv4::unregisterBackendType();
|
isc::dhcp::PgSqlConfigBackendDHCPv4::unregisterBackendType();
|
||||||
isc::dhcp::PgSqlConfigBackendDHCPv6::unregisterBackendType();
|
isc::dhcp::PgSqlConfigBackendDHCPv6::unregisterBackendType();
|
||||||
IOServiceMgr::instance().unregisterIOService(isc::dhcp::PgSqlConfigBackendImpl::getIOService());
|
IOServicePtr io_service = isc::dhcp::PgSqlConfigBackendImpl::getIOService();
|
||||||
if (isc::dhcp::PgSqlConfigBackendImpl::getIOService()) {
|
if (io_service) {
|
||||||
isc::dhcp::PgSqlConfigBackendImpl::getIOService()->stopAndPoll();
|
IOServiceMgr::instance().unregisterIOService(io_service);
|
||||||
|
io_service->stopAndPoll();
|
||||||
|
isc::dhcp::PgSqlConfigBackendImpl::setIOService(IOServicePtr());
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user