diff options
author | Olivier Galibert <galibert@pobox.com> | 2020-06-18 18:22:40 +0200 |
---|---|---|
committer | Olivier Galibert <galibert@pobox.com> | 2020-06-18 18:22:40 +0200 |
commit | e96ed3b0ebd5920e8aff2914a6ff28b435210717 (patch) | |
tree | 70c256834c0541ba26f422972d054dd941368627 | |
parent | a7c369c993f8f5e89d791450bcff7fdbf79ae502 (diff) |
emumem: Fix bad destruction order by not removing the notifier on cache destruction, they're supposed to be long-lived anyway [O. Galibert]
-rw-r--r-- | src/emu/emumem.h | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/emu/emumem.h b/src/emu/emumem.h index 03b8b0a74a9..ce51c35e604 100644 --- a/src/emu/emumem.h +++ b/src/emu/emumem.h @@ -1150,8 +1150,6 @@ public: private: address_space * m_space; - int m_notifier_id; // id to remove the notifier on destruction - offs_t m_addrmask; // address mask offs_t m_addrstart_r; // minimum valid address for reading offs_t m_addrend_r; // maximum valid address for reading @@ -2004,18 +2002,18 @@ set(address_space *space, std::pair<void *, void *> rw) m_space = space; m_addrmask = space->addrmask(); - m_notifier_id = space->add_change_notifier([this](read_or_write mode) { - if(u32(mode) & u32(read_or_write::READ)) { - m_addrend_r = 0; - m_addrstart_r = 1; - m_cache_r = nullptr; - } - if(u32(mode) & u32(read_or_write::WRITE)) { - m_addrend_w = 0; - m_addrstart_w = 1; - m_cache_w = nullptr; - } - }); + space->add_change_notifier([this](read_or_write mode) { + if(u32(mode) & u32(read_or_write::READ)) { + m_addrend_r = 0; + m_addrstart_r = 1; + m_cache_r = nullptr; + } + if(u32(mode) & u32(read_or_write::WRITE)) { + m_addrend_w = 0; + m_addrstart_w = 1; + m_cache_w = nullptr; + } + }); m_root_read = (handler_entry_read <Width, AddrShift, Endian> *)(rw.first); m_root_write = (handler_entry_write<Width, AddrShift, Endian> *)(rw.second); @@ -2032,8 +2030,6 @@ template<int Width, int AddrShift, endianness_t Endian> emu::detail::memory_access_cache<Width, AddrShift, Endian>:: ~memory_access_cache() { - if(m_space) - m_space->remove_change_notifier(m_notifier_id); } #endif /* MAME_EMU_EMUMEM_H */ |