// Re-open lease and host database with new parameters.
try {
+ DatabaseConnection::db_lost_callback =
+ boost::bind(&ControlledDhcpv4Srv::dbLostCallback, srv, _1);
CfgDbAccessPtr cfg_db = CfgMgr::instance().getStagingCfg()->getCfgDbAccess();
cfg_db->setAppendedParameters("universe=4");
- cfg_db->createManagers(boost::bind(&ControlledDhcpv4Srv::dbLostCallback, srv, _1));
+ cfg_db->createManagers();
} catch (const std::exception& ex) {
err << "Unable to open database: " << ex.what();
return (isc::config::createAnswer(1, err.str()));
try {
cleanup();
+ // The closure captures either a shared pointer (memory leak)
+ // or a raw pointer (pointing to a deleted object).
+ DatabaseConnection::db_lost_callback = 0;
+
timer_mgr_->unregisterTimers();
// Close the command socket (if it exists).
// Re-open lease and host database with new parameters.
try {
CfgDbAccessPtr cfg_db = CfgMgr::instance().getCurrentCfg()->getCfgDbAccess();
- cfg_db->createManagers(boost::bind(&ControlledDhcpv4Srv::dbLostCallback, this, _1));
+ cfg_db->createManagers();
reopened = true;
} catch (const std::exception& ex) {
LOG_ERROR(dhcp4_logger, DHCP4_DB_RECONNECT_ATTEMPT_FAILED).arg(ex.what());
// Re-open lease and host database with new parameters.
try {
+ DatabaseConnection::db_lost_callback =
+ boost::bind(&ControlledDhcpv6Srv::dbLostCallback, srv, _1);
CfgDbAccessPtr cfg_db = CfgMgr::instance().getStagingCfg()->getCfgDbAccess();
cfg_db->setAppendedParameters("universe=6");
- cfg_db->createManagers(boost::bind(&ControlledDhcpv6Srv::dbLostCallback, srv, _1));
+ cfg_db->createManagers();
} catch (const std::exception& ex) {
return (isc::config::createAnswer(1, "Unable to open database: "
+ std::string(ex.what())));
try {
cleanup();
+ // The closure captures either a shared pointer (memory leak)
+ // or a raw pointer (pointing to a deleted object).
+ DatabaseConnection::db_lost_callback = 0;
+
timer_mgr_->unregisterTimers();
// Close the command socket (if it exists).
// Re-open lease and host database with new parameters.
try {
CfgDbAccessPtr cfg_db = CfgMgr::instance().getCurrentCfg()->getCfgDbAccess();
- cfg_db->createManagers(boost::bind(&ControlledDhcpv6Srv::dbLostCallback, this, _1));
+ cfg_db->createManagers();
reopened = true;
} catch (const std::exception& ex) {
LOG_ERROR(dhcp6_logger, DHCP6_DB_RECONNECT_ATTEMPT_FAILED).arg(ex.what());