Commit e1696244 authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

gui: adding remove memory component option

parent f53c6c67
Pipeline #42510 passed with stage
in 1 minute and 18 seconds
......@@ -139,8 +139,10 @@ static void show_all_components(component_editor& ed)
}
if (ImGui::MenuItem("Delete")) {
printf("delete\n");
log_w.log(3, "Can not delete component");
if (selected_type == component_type::memory) {
ed.mod.free(*selected_compo);
selected_compo = nullptr;
}
}
ImGui::EndPopup();
}
......
......@@ -1120,8 +1120,11 @@ void modeling::free(component& c) noexcept
}
}
descriptions.free(c.desc);
file_paths.free(c.path);
if (auto* desc = descriptions.try_to_get(c.desc); desc)
descriptions.free(*desc);
if (auto* path = file_paths.try_to_get(c.path); path)
file_paths.free(*path);
components.free(c);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment