Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
3e963e68
Commit
3e963e68
authored
Aug 24, 2012
by
Marcin Siodelski
Browse files
[master] Fixed memory leak in IfaceMgr singleton.
parent
f0a88101
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcp/iface_mgr.cc
View file @
3e963e68
...
...
@@ -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
)
...
...
src/lib/dhcp/iface_mgr.h
View file @
3e963e68
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment