Skip to content
Snippets Groups Projects
Unverified Commit 978911f2 authored by Leon Dietrich's avatar Leon Dietrich
Browse files

fix: better handling of std::shared_ptr due to new c++20

parent ad7f307a
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -7,9 +7,11 @@ namespace rmrf::ui { ...@@ -7,9 +7,11 @@ namespace rmrf::ui {
view::view(std::shared_ptr<view> parent) : parent_view{parent} { view::view(std::shared_ptr<view> parent) : parent_view{parent} {
if(this->parent_view != nullptr) { if(this->parent_view != nullptr) {
std::shared_ptr<new_child_event> child_event(new new_child_event(this)); const std::shared_ptr<new_child_event> child_event(new new_child_event(this));
this->parent_view->schedule_update(child_event); this->parent_view->schedule_update(child_event);
delete child_event; if (child_event->unique()) {
child_event->reset(); // Delete the object if it wasn't stored elsewhere
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment