mirror of
https://github.com/holub/mame
synced 2025-06-06 04:43:45 +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_basename(image_name);
|
||||
|
||||
/* unload all images */
|
||||
unload_all();
|
||||
|
||||
fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s",
|
||||
image->device().name(),
|
||||
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
|
||||
options_extract();
|
||||
@ -227,11 +231,16 @@ void image_manager::postdevice_init()
|
||||
{
|
||||
/* retrieve image error message */
|
||||
std::string image_err = std::string(image->error());
|
||||
|
||||
/* unload all images */
|
||||
unload_all();
|
||||
|
||||
fatalerror_exitcode(machine(), MAMERR_DEVICE, "Device %s load failed: %s",
|
||||
image->device().name(),
|
||||
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:
|
||||
// construction/destruction
|
||||
image_manager(running_machine &machine);
|
||||
~image_manager();
|
||||
|
||||
|
||||
void unload_all();
|
||||
void postdevice_init();
|
||||
std::string &mandatory_scan(std::string &mandatory);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user