Fix memory leak on address_space_specific destruction and add a missing init [O. Galibert]

This commit is contained in:
Olivier Galibert 2020-11-15 13:27:48 +01:00
parent 27309ec944
commit 2ec01d1901
3 changed files with 11 additions and 0 deletions

View File

@ -85,6 +85,11 @@ void k054321_device::device_start()
save_item(NAME(m_active));
}
void k054321_device::device_reset()
{
m_volume = 0;
}
void k054321_device::device_add_mconfig(machine_config &config)
{
for (int i = 0; i < 3; i++)

View File

@ -26,6 +26,7 @@ public:
protected:
void device_start() override;
void device_reset() override;
virtual void device_add_mconfig(machine_config &config) override;
private:

View File

@ -523,6 +523,11 @@ public:
m_dispatch_write = m_root_write->get_dispatch();
}
~address_space_specific() {
m_root_read->unref();
m_root_write->unref();
}
std::pair<void *, void *> get_cache_info() override {
std::pair<void *, void *> rw;
rw.first = m_root_read;