Some more cleanup in the plugins code.

This commit is contained in:
Volker Ruppert 2021-04-03 18:26:03 +00:00
parent 7b355cd399
commit d8b25c5f26
3 changed files with 3 additions and 8 deletions

View File

@ -440,9 +440,8 @@ void bx_devices_c::exit()
bx_virt_timer.setup();
bx_slowdown_timer.exit();
// unload optional plugins first
// unload device plugins
bx_unload_plugins();
bx_unload_core_plugins();
// remove runtime parameter handlers
SIM->get_param_num(BXPN_KBD_PASTE_DELAY)->set_handler(NULL);
SIM->get_param_num(BXPN_MOUSE_ENABLED)->set_handler(NULL);

View File

@ -874,6 +874,7 @@ void bx_unload_plugins()
{
device_t *device, *next;
// unload non-core plugins first
device = devices;
while (device != NULL) {
if (device->plugin != NULL) {
@ -892,12 +893,8 @@ void bx_unload_plugins()
device = next;
}
devices = NULL;
}
void bx_unload_core_plugins()
{
device_t *device, *next;
// now it's safe to unload core plugins
device = core_devices;
while (device != NULL) {
if (device->plugin != NULL) {

View File

@ -346,7 +346,6 @@ extern void bx_unload_plugin_type(const char *name, Bit16u type);
extern void bx_init_plugins(void);
extern void bx_reset_plugins(unsigned);
extern void bx_unload_plugins(void);
extern void bx_unload_core_plugins(void);
extern void bx_plugins_register_state(void);
extern void bx_plugins_after_restore_state(void);