diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/dhcp4/ctrl_dhcp4_srv.cc | 4 | ||||
-rw-r--r-- | src/bin/dhcp6/ctrl_dhcp6_srv.cc | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.cc b/src/bin/dhcp4/ctrl_dhcp4_srv.cc index ed0278fa8b..0c0a24c174 100644 --- a/src/bin/dhcp4/ctrl_dhcp4_srv.cc +++ b/src/bin/dhcp4/ctrl_dhcp4_srv.cc @@ -913,7 +913,7 @@ ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) { // Allow DB reconnect on startup. The database connection parameters specify // respective details. - DbConnectionInitWithRetry retry; + std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry()); // Single stream instance used in all error clauses std::ostringstream err; @@ -1092,6 +1092,8 @@ ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) { return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str())); } + dbr.reset(); + /// Let postponed hook initializations to run. try { ControlledDhcpv4Srv::getInstance()->getIOService()->poll(); diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc index cda7f8b87b..e304537ba9 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc @@ -918,7 +918,7 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) { // Allow DB reconnect on startup. The database connection parameters specify // respective details. - DbConnectionInitWithRetry retry; + std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry()); // Single stream instance used in all error clauses std::ostringstream err; @@ -1112,6 +1112,8 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) { return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str())); } + dbr.reset(); + /// Let postponed hook initializations to run. try { ControlledDhcpv6Srv::getInstance()->getIOService()->poll(); |