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 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 *)(rw.first); m_root_write = (handler_entry_write *)(rw.second); @@ -2032,8 +2030,6 @@ template emu::detail::memory_access_cache:: ~memory_access_cache() { - if(m_space) - m_space->remove_change_notifier(m_notifier_id); } #endif /* MAME_EMU_EMUMEM_H */