File tree 7 files changed +16
-26
lines changed
7 files changed +16
-26
lines changed Original file line number Diff line number Diff line change @@ -209,16 +209,7 @@ class NakedDhcpv4Srv: public Dhcpv4Srv {
209
209
fake_received_.push_back (pkt);
210
210
}
211
211
212
- virtual ~NakedDhcpv4Srv () {
213
- // Close the lease database
214
- isc::dhcp::LeaseMgrFactory::destroy ();
215
-
216
- getIOService ()->restart ();
217
- try {
218
- getIOService ()->poll ();
219
- } catch (...) {
220
- }
221
- }
212
+ virtual ~NakedDhcpv4Srv () = default ;
222
213
223
214
// / @brief Runs processing DHCPDISCOVER.
224
215
// /
Original file line number Diff line number Diff line change @@ -216,11 +216,7 @@ class NakedDhcpv6Srv: public isc::dhcp::Dhcpv6Srv {
216
216
fake_received_.push_back (pkt);
217
217
}
218
218
219
- virtual ~NakedDhcpv6Srv () {
220
- // Close the lease database
221
- isc::dhcp::LeaseMgrFactory::destroy ();
222
- getIOService ()->stopAndPoll ();
223
- }
219
+ virtual ~NakedDhcpv6Srv () = default ;
224
220
225
221
// / @brief Processes incoming Solicit message.
226
222
// /
Original file line number Diff line number Diff line change @@ -429,11 +429,8 @@ int load(LibraryHandle& handle) {
429
429
// / @return 0 if deregistration was successful, 1 otherwise
430
430
int unload () {
431
431
if (impl) {
432
- IOServicePtr io_service = impl->getIOService ();
433
- IOServiceMgr::instance ().unregisterIOService (io_service);
434
- io_service->stopAndPoll ();
432
+ IOServiceMgr::instance ().unregisterIOService (impl->getIOService ());
435
433
impl.reset ();
436
- io_service->stopAndPoll ();
437
434
}
438
435
LOG_INFO (ha_logger, HA_DEINIT_OK);
439
436
return (0 );
Original file line number Diff line number Diff line change @@ -66,6 +66,9 @@ HAImpl::~HAImpl() {
66
66
// than relying on destruction order.
67
67
service->stopClientAndListener ();
68
68
}
69
+ config_.reset ();
70
+ services_.reset (new HAServiceMapper ());
71
+ io_service_->stopAndPoll ();
69
72
}
70
73
71
74
void
Original file line number Diff line number Diff line change @@ -245,7 +245,6 @@ class HAImpl : public boost::noncopyable {
245
245
246
246
// / @brief Pointer to the high availability services (state machines).
247
247
HAServiceMapperPtr services_;
248
-
249
248
};
250
249
251
250
// / @brief Pointer to the High Availability hooks library implementation.
Original file line number Diff line number Diff line change @@ -94,9 +94,11 @@ int unload() {
94
94
// Unregister the factories and remove MySQL backends
95
95
isc::dhcp::MySqlConfigBackendDHCPv4::unregisterBackendType ();
96
96
isc::dhcp::MySqlConfigBackendDHCPv6::unregisterBackendType ();
97
- IOServiceMgr::instance ().unregisterIOService (isc::dhcp::MySqlConfigBackendImpl::getIOService ());
98
- if (isc::dhcp::MySqlConfigBackendImpl::getIOService ()) {
99
- isc::dhcp::MySqlConfigBackendImpl::getIOService ()->stopAndPoll ();
97
+ IOServicePtr io_service = isc::dhcp::MySqlConfigBackendImpl::getIOService ();
98
+ if (io_service) {
99
+ IOServiceMgr::instance ().unregisterIOService (io_service);
100
+ io_service->stopAndPoll ();
101
+ isc::dhcp::MySqlConfigBackendImpl::setIOService (IOServicePtr ());
100
102
}
101
103
return (0 );
102
104
}
Original file line number Diff line number Diff line change @@ -94,9 +94,11 @@ int unload() {
94
94
// Unregister the factories and remove PostgreSQL backends
95
95
isc::dhcp::PgSqlConfigBackendDHCPv4::unregisterBackendType ();
96
96
isc::dhcp::PgSqlConfigBackendDHCPv6::unregisterBackendType ();
97
- IOServiceMgr::instance ().unregisterIOService (isc::dhcp::PgSqlConfigBackendImpl::getIOService ());
98
- if (isc::dhcp::PgSqlConfigBackendImpl::getIOService ()) {
99
- isc::dhcp::PgSqlConfigBackendImpl::getIOService ()->stopAndPoll ();
97
+ IOServicePtr io_service = isc::dhcp::PgSqlConfigBackendImpl::getIOService ();
98
+ if (io_service) {
99
+ IOServiceMgr::instance ().unregisterIOService (io_service);
100
+ io_service->stopAndPoll ();
101
+ isc::dhcp::PgSqlConfigBackendImpl::setIOService (IOServicePtr ());
100
102
}
101
103
return (0 );
102
104
}
You can’t perform that action at this time.
0 commit comments