Fix spawned selector lifetime

This commit is contained in:
Nikita Lisitsa 2023-01-01 21:54:49 +03:00
parent 8425900fe0
commit c0c659ee61

View file

@ -305,6 +305,7 @@ namespace psemek::ui
auto patch_callback_recursive = util::recursive([&](auto && self, struct selector * target) -> void {
target->on_selected([target, close, cb = target->on_selected()](std::size_t index){
[[maybe_unused]] auto shared_target = target->shared_from_this();
close();
if (cb)
cb(index);