mirror of
https://github.com/holub/mame
synced 2025-05-25 23:35:26 +03:00
Fix memory leak visible apollo driver (nw)
This commit is contained in:
parent
996e96fa4a
commit
fac598ebd1
@ -473,7 +473,7 @@ void threecom3c505_device::data_buffer_fifo::start(
|
|||||||
m_size = RX_FIFO_SIZE; // size;
|
m_size = RX_FIFO_SIZE; // size;
|
||||||
for (i = 0; i < m_size; i++)
|
for (i = 0; i < m_size; i++)
|
||||||
{
|
{
|
||||||
m_db[i] = new data_buffer();
|
m_db[i] = global_alloc(data_buffer());
|
||||||
m_db[i]->start(device, db_size);
|
m_db[i]->start(device, db_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -485,6 +485,14 @@ void threecom3c505_device::data_buffer_fifo::reset()
|
|||||||
m_count = 0;
|
m_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
threecom3c505_device::data_buffer_fifo::~data_buffer_fifo()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < m_size; i++)
|
||||||
|
{
|
||||||
|
global_free(m_db[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int threecom3c505_device::data_buffer_fifo::put(const UINT8 data[], const int length)
|
int threecom3c505_device::data_buffer_fifo::put(const UINT8 data[], const int length)
|
||||||
{
|
{
|
||||||
UINT16 next_index = (m_put_index + 1) % m_size;
|
UINT16 next_index = (m_put_index + 1) % m_size;
|
||||||
|
@ -175,6 +175,7 @@ private:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
data_buffer_fifo();
|
data_buffer_fifo();
|
||||||
|
~data_buffer_fifo();
|
||||||
void start(threecom3c505_device *device, INT32 size, INT32 db_size);
|
void start(threecom3c505_device *device, INT32 size, INT32 db_size);
|
||||||
void reset();
|
void reset();
|
||||||
int put(const UINT8 data[], const int length);
|
int put(const UINT8 data[], const int length);
|
||||||
|
Loading…
Reference in New Issue
Block a user