mirror of
https://github.com/holub/mame
synced 2025-07-12 21:19:14 +03:00
Move call to legacy device's stop function to device_stop() from the
destructor, in case the device tries to do something machine-related.
This commit is contained in:
parent
06c4761151
commit
4bde2a6110
@ -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
|
||||
|
@ -432,6 +432,7 @@ protected:
|
||||
virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
virtual void device_stop();
|
||||
|
||||
// access to legacy configuration info
|
||||
INT64 get_legacy_int(UINT32 state) const;
|
||||
|
Loading…
Reference in New Issue
Block a user