mirror of
https://github.com/libretro/mame.git
synced 2024-11-23 17:39:50 +00:00
(mess) psxcd: free incomplete result pointers on exit or reset (nw)
This commit is contained in:
parent
8e9303fc33
commit
2d474c6a3b
@ -145,6 +145,21 @@ void psxcd_device::device_start()
|
||||
save_item(NAME(m_param_count));
|
||||
}
|
||||
|
||||
void psxcd_device::device_stop()
|
||||
{
|
||||
for (int i = 0; i < MAX_PSXCD_TIMERS; i++)
|
||||
{
|
||||
if(m_timerinuse[i] && m_timers[i]->ptr())
|
||||
global_free(m_timers[i]->ptr());
|
||||
}
|
||||
while(res_queue)
|
||||
{
|
||||
command_result *res = res_queue->next;
|
||||
global_free(res_queue);
|
||||
res_queue = res;
|
||||
}
|
||||
}
|
||||
|
||||
void psxcd_device::device_reset()
|
||||
{
|
||||
next_read_event = -1;
|
||||
@ -152,6 +167,8 @@ void psxcd_device::device_reset()
|
||||
|
||||
for (int i = 0; i < MAX_PSXCD_TIMERS; i++)
|
||||
{
|
||||
if(m_timerinuse[i] && m_timers[i]->ptr())
|
||||
global_free(m_timers[i]->ptr());
|
||||
m_timers[i]->adjust(attotime::never, 0, attotime::never);
|
||||
m_timerinuse[i] = false;
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void device_start();
|
||||
virtual void device_stop();
|
||||
virtual void device_reset();
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user