mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-11-10 12:47:40 +01:00
Fixed bug when removing certain modules
This commit is contained in:
parent
034ada1ed7
commit
7506e45d3b
@ -7,6 +7,7 @@
|
||||
namespace module_manager_menu {
|
||||
char modName[1024];
|
||||
std::vector<std::string> modTypes;
|
||||
std::vector<std::string> toBeRemoved;
|
||||
std::string modTypesTxt;
|
||||
int modTypeId;
|
||||
|
||||
@ -32,6 +33,8 @@ namespace module_manager_menu {
|
||||
|
||||
float height = ImGui::CalcTextSize("-").y;
|
||||
|
||||
toBeRemoved.clear();
|
||||
|
||||
for (auto& [name, inst] : core::moduleManager.instances) {
|
||||
ImGui::TableNextRow();
|
||||
|
||||
@ -45,12 +48,16 @@ namespace module_manager_menu {
|
||||
ImVec2 origPos = ImGui::GetCursorPos();
|
||||
ImGui::SetCursorPos(ImVec2(origPos.x - 3, origPos.y));
|
||||
if (ImGui::Button(("##module_mgr_"+name).c_str(), ImVec2(height,height))) {
|
||||
core::moduleManager.deleteInstance(name);
|
||||
toBeRemoved.push_back(name);
|
||||
}
|
||||
ImGui::SetCursorPos(ImVec2(origPos.x + 2, origPos.y - 5));
|
||||
ImGui::Text("_");
|
||||
}
|
||||
ImGui::EndTable();
|
||||
|
||||
for (auto& rem : toBeRemoved) {
|
||||
core::moduleManager.deleteInstance(rem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user