Netlist: Fix a memory leak
This commit is contained in:
parent
0cf1dc1752
commit
c9a4d6b0a8
@ -904,6 +904,21 @@ NETLIB_FUNC_VOID(nic9316_sub, update_outputs, (void))
|
|||||||
#define ENTRY1(_nic, _name) m_list.add(new net_device_t_factory< _nic >( # _name, xstr(_nic) ));
|
#define ENTRY1(_nic, _name) m_list.add(new net_device_t_factory< _nic >( # _name, xstr(_nic) ));
|
||||||
#define ENTRY(_nic, _name) ENTRY1(NETLIB_NAME(_nic), _name)
|
#define ENTRY(_nic, _name) ENTRY1(NETLIB_NAME(_nic), _name)
|
||||||
|
|
||||||
|
netlist_factory::netlist_factory()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
netlist_factory::~netlist_factory()
|
||||||
|
{
|
||||||
|
for (list_t::entry_t *e = m_list.first(); e != NULL; e = m_list.next(e))
|
||||||
|
{
|
||||||
|
net_device_t_base_factory *p = e->object();
|
||||||
|
delete p;
|
||||||
|
}
|
||||||
|
m_list.reset();
|
||||||
|
}
|
||||||
|
|
||||||
void netlist_factory::initialize()
|
void netlist_factory::initialize()
|
||||||
{
|
{
|
||||||
ENTRY(R, NETDEV_R)
|
ENTRY(R, NETDEV_R)
|
||||||
|
@ -1143,6 +1143,9 @@ class netlist_factory
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
netlist_factory();
|
||||||
|
~netlist_factory();
|
||||||
|
|
||||||
void initialize();
|
void initialize();
|
||||||
|
|
||||||
netlist_device_t *new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const;
|
netlist_device_t *new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user