summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/devlegcy.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2011-04-30 18:38:27 +0000
committer Aaron Giles <aaron@aarongiles.com>2011-04-30 18:38:27 +0000
commit4bde2a6110b34043c07d249011eead2bafeb4851 (patch)
tree5d045e451f296267d9e1630dcda5193b5d545aac /src/emu/devlegcy.c
parent06c476115107766f7fce93c069b8d2c3fac1f573 (diff)
Move call to legacy device's stop function to device_stop() from the
destructor, in case the device tries to do something machine-related.
Diffstat (limited to 'src/emu/devlegcy.c')
-rw-r--r--src/emu/devlegcy.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/emu/devlegcy.c b/src/emu/devlegcy.c
index 19e130d84dc..d8f93ffba9b 100644
--- a/src/emu/devlegcy.c
+++ b/src/emu/devlegcy.c
@@ -77,12 +77,6 @@ legacy_device_base::legacy_device_base(const machine_config &mconfig, device_typ
legacy_device_base::~legacy_device_base()
{
- if (m_started)
- {
- device_stop_func stop_func = reinterpret_cast<device_stop_func>(get_legacy_fct(DEVINFO_FCT_STOP));
- if (stop_func != NULL)
- (*stop_func)(this);
- }
global_free(m_token);
global_free(m_inline_config);
}
@@ -238,6 +232,20 @@ void legacy_device_base::device_reset()
}
+//-------------------------------------------------
+// device_stop - called to stop a device
+//-------------------------------------------------
+
+void legacy_device_base::device_stop()
+{
+ if (m_started)
+ {
+ device_stop_func stop_func = reinterpret_cast<device_stop_func>(get_legacy_fct(DEVINFO_FCT_STOP));
+ if (stop_func != NULL)
+ (*stop_func)(this);
+ }
+}
+
//**************************************************************************
// LEGACY SOUND DEVICE