Skip to content

Commit

Permalink
Merge pull request #110 from NuiCpp/fix/dangling-attribute-function
Browse files Browse the repository at this point in the history
Fixed dangling reference to function.
  • Loading branch information
5cript authored Jun 12, 2024
2 parents 513c50e + ed36fe3 commit 0501f22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nui/include/nui/frontend/attributes/reference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Nui::Attributes
requires std::invocable<T, Nui::val&&>
Attribute onMaterialize(T&& func) const
{
return operator=([&func](std::weak_ptr<Dom::BasicElement>&& element) {
return operator=([func = std::forward<T>(func)](std::weak_ptr<Dom::BasicElement>&& element) {
func(element.lock()->val());
});
}
Expand Down

0 comments on commit 0501f22

Please sign in to comment.