summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Oliver Stöneberg <firewave@users.noreply.github.com>2014-05-14 09:37:27 +0000
committer Oliver Stöneberg <firewave@users.noreply.github.com>2014-05-14 09:37:27 +0000
commit2836bb12bce71998c43a6455339e22b249a55410 (patch)
tree7ee214f0d9fd1397969fcc67e3b134de9273c80a /src
parentbf35b4dbb432b8d46d059781820bfc4d8e80b3b0 (diff)
fixed memory leaks in floppy_image_device (nw)
Diffstat (limited to 'src')
-rw-r--r--src/emu/imagedev/floppy.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/emu/imagedev/floppy.c b/src/emu/imagedev/floppy.c
index 1eb1d5a1e40..e05f0fbe391 100644
--- a/src/emu/imagedev/floppy.c
+++ b/src/emu/imagedev/floppy.c
@@ -147,7 +147,8 @@ floppy_image_device::floppy_image_device(const machine_config &mconfig, device_t
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_image_interface(mconfig, *this),
device_slot_card_interface(mconfig, *this),
- image(NULL)
+ image(NULL),
+ fif_list(NULL)
{
extension_list[0] = '\0';
}
@@ -158,6 +159,12 @@ floppy_image_device::floppy_image_device(const machine_config &mconfig, device_t
floppy_image_device::~floppy_image_device()
{
+ for(floppy_image_format_t *format = fif_list; format; ) {
+ floppy_image_format_t* tmp_format = format;
+ format = format->next;
+ delete tmp_format;
+ }
+ fif_list = NULL;
}
void floppy_image_device::setup_load_cb(load_cb cb)
@@ -188,7 +195,7 @@ void floppy_image_device::setup_wpt_cb(wpt_cb cb)
void floppy_image_device::set_formats(const floppy_format_type *formats)
{
extension_list[0] = '\0';
- fif_list = 0;
+ fif_list = NULL;
for(int cnt=0; formats[cnt]; cnt++)
{
// allocate a new format