mirror of
https://github.com/holub/mame
synced 2025-07-02 00:29:37 +03:00
Fix image unload (nw)
This commit is contained in:
parent
2c0cf88891
commit
7f02a9e47b
@ -51,6 +51,9 @@ image_manager::image_manager(running_machine &machine)
|
|||||||
std::string image_err = std::string(image->error());
|
std::string image_err = std::string(image->error());
|
||||||
std::string image_basename(image_name);
|
std::string image_basename(image_name);
|
||||||
|
|
||||||
|
/* unload all images */
|
||||||
|
unload_all();
|
||||||
|
|
||||||
fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s",
|
fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s",
|
||||||
image->device().name(),
|
image->device().name(),
|
||||||
image_basename.c_str(),
|
image_basename.c_str(),
|
||||||
@ -63,9 +66,10 @@ image_manager::image_manager(running_machine &machine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// image_manager - destructor
|
// unload_all - unload all images and
|
||||||
|
// extract options
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
image_manager::~image_manager()
|
void image_manager::unload_all()
|
||||||
{
|
{
|
||||||
// extract the options
|
// extract the options
|
||||||
options_extract();
|
options_extract();
|
||||||
@ -228,10 +232,15 @@ void image_manager::postdevice_init()
|
|||||||
/* retrieve image error message */
|
/* retrieve image error message */
|
||||||
std::string image_err = std::string(image->error());
|
std::string image_err = std::string(image->error());
|
||||||
|
|
||||||
|
/* unload all images */
|
||||||
|
unload_all();
|
||||||
|
|
||||||
fatalerror_exitcode(machine(), MAMERR_DEVICE, "Device %s load failed: %s",
|
fatalerror_exitcode(machine(), MAMERR_DEVICE, "Device %s load failed: %s",
|
||||||
image->device().name(),
|
image->device().name(),
|
||||||
image_err.c_str());
|
image_err.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* add a callback for when we shut down */
|
||||||
|
machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(image_manager::unload_all), this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,8 +20,8 @@ class image_manager
|
|||||||
public:
|
public:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
image_manager(running_machine &machine);
|
image_manager(running_machine &machine);
|
||||||
~image_manager();
|
|
||||||
|
|
||||||
|
void unload_all();
|
||||||
void postdevice_init();
|
void postdevice_init();
|
||||||
std::string &mandatory_scan(std::string &mandatory);
|
std::string &mandatory_scan(std::string &mandatory);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user