BIND 10 master, updated. 3e963e68d9f5828fb4c4993a83e15be24eaeafc1 [master] Fixed memory leak in IfaceMgr singleton.
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Aug 24 11:22:50 UTC 2012
The branch, master has been updated
via 3e963e68d9f5828fb4c4993a83e15be24eaeafc1 (commit)
from f0a881014d19120d899669a500400683d6709124 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3e963e68d9f5828fb4c4993a83e15be24eaeafc1
Author: Marcin Siodelski <marcin at isc.org>
Date: Fri Aug 24 13:22:26 2012 +0200
[master] Fixed memory leak in IfaceMgr singleton.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dhcp/iface_mgr.cc | 20 ++------------------
src/lib/dhcp/iface_mgr.h | 7 -------
2 files changed, 2 insertions(+), 25 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/iface_mgr.cc b/src/lib/dhcp/iface_mgr.cc
index 4a24260..90f6353 100644
--- a/src/lib/dhcp/iface_mgr.cc
+++ b/src/lib/dhcp/iface_mgr.cc
@@ -36,26 +36,10 @@ using namespace isc::util::io::internal;
namespace isc {
namespace dhcp {
-/// IfaceMgr is a singleton implementation
-IfaceMgr* IfaceMgr::instance_ = 0;
-
-void
-IfaceMgr::instanceCreate() {
- if (instance_) {
- // no need to do anything. Instance is already created.
- // Who called it again anyway? Uh oh. Had to be us, as
- // this is private method.
- return;
- }
- instance_ = new IfaceMgr();
-}
-
IfaceMgr&
IfaceMgr::instance() {
- if (instance_ == 0) {
- instanceCreate();
- }
- return (*instance_);
+ static IfaceMgr iface_mgr;
+ return (iface_mgr);
}
IfaceMgr::Iface::Iface(const std::string& name, int ifindex)
diff --git a/src/lib/dhcp/iface_mgr.h b/src/lib/dhcp/iface_mgr.h
index 7de6a44..36ad0ea 100644
--- a/src/lib/dhcp/iface_mgr.h
+++ b/src/lib/dhcp/iface_mgr.h
@@ -537,9 +537,6 @@ protected:
/// List of available interfaces
IfaceCollection ifaces_;
- /// a pointer to a sole instance of this class (a singleton)
- static IfaceMgr * instance_;
-
// TODO: Also keep this interface on Iface once interface detection
// is implemented. We may need it e.g. to close all sockets on
// specific interface
@@ -580,10 +577,6 @@ protected:
SessionCallback session_callback_;
private:
- /// @brief Creates a single instance of this class (a singleton implementation)
- static void
- instanceCreate();
-
/// @brief Joins IPv6 multicast group on a socket.
///
/// Socket must be created and bound to an address. Note that this
More information about the bind10-changes
mailing list