From 5cbf42b12d047d07ca1fe717c6f86779416be5a2 Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Thu, 4 Jul 2019 05:04:30 +0300 Subject: [PATCH] [#639,!410] clear cache_ptr_ before unloading library --- src/lib/dhcpsrv/host_mgr.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/dhcpsrv/host_mgr.cc b/src/lib/dhcpsrv/host_mgr.cc index 94859dfad3..4ed8b9ee23 100644 --- a/src/lib/dhcpsrv/host_mgr.cc +++ b/src/lib/dhcpsrv/host_mgr.cc @@ -48,6 +48,9 @@ HostMgr::addBackend(const std::string& access) { bool HostMgr::delBackend(const std::string& db_type) { + if (getHostMgrPtr()->cache_ptr_->getType() == db_type) { + getHostMgrPtr()->cache_ptr_.reset(); + } return (HostDataSourceFactory::del(getHostMgrPtr()->alternate_sources_, db_type)); } -- 2.47.2