diff --git a/bochs/gui/siminterface.cc b/bochs/gui/siminterface.cc index 6bb9b40a2..b1bf14aef 100644 --- a/bochs/gui/siminterface.cc +++ b/bochs/gui/siminterface.cc @@ -1383,7 +1383,9 @@ bx_bool bx_real_sim_c::opt_plugin_ctrl(const char *plugname, bx_bool load) if (load != PLUG_device_present(plugname)) { if (load) { if (PLUG_load_opt_plugin(plugname)) { - new bx_param_bool_c(base, plugname, "", "", 1); + if (base->get_by_name(plugname) == NULL) { + new bx_param_bool_c(base, plugname, "", "", 1); + } return 1; } else { BX_PANIC(("optional plugin '%s' not found", plugname)); diff --git a/bochs/gui/wxdialog.cc b/bochs/gui/wxdialog.cc index b2a27d287..b01220ead 100644 --- a/bochs/gui/wxdialog.cc +++ b/bochs/gui/wxdialog.cc @@ -593,11 +593,13 @@ PluginControlDialog::PluginControlDialog( buttonSizer->Add(btn, 0, wxALL, 5); btn = new wxButton(this, wxID_OK, BTNLABEL_OK); buttonSizer->Add(btn, 0, wxALL, 5); - // add loaded plugins to the listbox + // make sure all plugins are loaded and add them to the listbox bx_list_c *plugin_ctrl = (bx_list_c*) SIM->get_param(BXPN_PLUGIN_CTRL); unsigned count = plugin_ctrl->get_size(); for (unsigned i = 0; i < count; i++) { - pluglist->Insert(wxString(plugin_ctrl->get(i)->get_name(), wxConvUTF8), i); + bx_param_bool_c *plugin = (bx_param_bool_c*)plugin_ctrl->get(i); + SIM->opt_plugin_ctrl(plugin->get_name(), 1); + pluglist->Insert(wxString(plugin->get_name(), wxConvUTF8), i); } btn_load->Enable(0); btn_unload->Enable(0); @@ -636,7 +638,7 @@ void PluginControlDialog::OnEvent(wxCommandEvent& event) if (SIM->opt_plugin_ctrl(buf, 1)) { tmpname.Printf(wxT("Plugin '%s' loaded"), buf); wxMessageBox(tmpname, wxT("Plugin Control"), wxOK | wxICON_INFORMATION, this); - pluglist->Insert(tmpname, pluglist->GetCount()); + pluglist->Insert(wxString(buf, wxConvUTF8), pluglist->GetCount()); } } break; diff --git a/bochs/iodev/usb/usb_ohci.cc b/bochs/iodev/usb/usb_ohci.cc index d7573fe2e..a24783fdf 100644 --- a/bochs/iodev/usb/usb_ohci.cc +++ b/bochs/iodev/usb/usb_ohci.cc @@ -122,8 +122,8 @@ void libusb_ohci_LTX_plugin_fini(void) { SIM->unregister_addon_option("usb_ohci"); bx_list_c *menu = (bx_list_c*)SIM->get_param("ports.usb"); - menu->remove("usb_ohci"); delete theUSB_OHCI; + menu->remove("ohci"); } // the device object diff --git a/bochs/iodev/usb/usb_uhci.cc b/bochs/iodev/usb/usb_uhci.cc index 31947bdc1..d3edb490a 100644 --- a/bochs/iodev/usb/usb_uhci.cc +++ b/bochs/iodev/usb/usb_uhci.cc @@ -95,8 +95,8 @@ void libusb_uhci_LTX_plugin_fini(void) { SIM->unregister_addon_option("usb_uhci"); bx_list_c *menu = (bx_list_c*)SIM->get_param("ports.usb"); - menu->remove("usb_uhci"); delete theUSB_UHCI; + menu->remove("uhci"); } // the device object diff --git a/bochs/iodev/usb/usb_xhci.cc b/bochs/iodev/usb/usb_xhci.cc index 0ccceba74..7637674f4 100644 --- a/bochs/iodev/usb/usb_xhci.cc +++ b/bochs/iodev/usb/usb_xhci.cc @@ -119,8 +119,8 @@ void libusb_xhci_LTX_plugin_fini(void) { SIM->unregister_addon_option("usb_xhci"); bx_list_c *menu = (bx_list_c*)SIM->get_param("ports.usb"); - menu->remove("usb_xhci"); delete theUSB_XHCI; + menu->remove("xhci"); } // the device object