From 6ef4a1452dffe2f0e6fa39307bffd699bf4ae9f7 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 6 Aug 2017 21:47:53 +1000 Subject: [PATCH] Revert "(nw) Fixed random crashing when swapping one slot device with another." This reverts commit 9968fc71b08b2a27e930d02333cb813977a37cbd. This hides the underlying problem that the options structure is getting out-of-sync. It's losing the image option but not the underlying option. Masking the problem doesn't fix it. --- src/emu/emuopts.cpp | 17 ----------------- src/emu/emuopts.h | 2 -- src/emu/image.cpp | 2 +- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp index 5e69f8627ce..11e369f0aca 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp @@ -1021,23 +1021,6 @@ slot_option &emu_options::slot_option(const std::string &device_name) } -//------------------------------------------------- -// find_image_option -//------------------------------------------------- - -const image_option *emu_options::find_image_option(const std::string &device_name) const -{ - auto iter = m_image_options.find(device_name); - return iter != m_image_options.end() ? iter->second : nullptr; -} - -image_option *emu_options::find_image_option(const std::string &device_name) -{ - auto iter = m_image_options.find(device_name); - return iter != m_image_options.end() ? iter->second : nullptr; -} - - //------------------------------------------------- // image_option //------------------------------------------------- diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h index faec84bc1a2..21df80b8a05 100644 --- a/src/emu/emuopts.h +++ b/src/emu/emuopts.h @@ -478,8 +478,6 @@ public: bool has_slot_option(const std::string &device_name) const { return find_slot_option(device_name) ? true : false; } const ::image_option &image_option(const std::string &device_name) const; ::image_option &image_option(const std::string &device_name); - ::image_option *find_image_option(const std::string &device_name); - const ::image_option *find_image_option(const std::string &device_name) const; protected: virtual void command_argument_processed() override; diff --git a/src/emu/image.cpp b/src/emu/image.cpp index a9f5c0fa3b3..06ae645fb39 100644 --- a/src/emu/image.cpp +++ b/src/emu/image.cpp @@ -209,7 +209,7 @@ void image_manager::options_extract() } // and set the option (provided that it hasn't been removed out from under us) - if (machine().options().find_image_option(image.instance_name())) + if (machine().options().exists(image.instance_name())) machine().options().image_option(image.instance_name()).specify(std::move(image_opt)); } }