debug_view_ = name; assumes that name is a string view of a string whose lifetime expands across frames. When a string_view of a temporary string object is passed in (and it is "equal" to one of the strings within the vector debug_views), the function silently fails, debug_view sooner become meaningless and ultimately causes random behavior.
I'll suggest a fix about changing debug_view_ = name; to debug_view_ = *debugView;
Also, auto debugView = std::find_if(debug_views_.cbegin(), debug_views_.cend(), [this](auto val) { return debug_view_ == val.first; }); seems to not be doing correct validation.
at
capsaicin_internal.cpp: 665
:debug_view_ = name;
assumes thatname
is a string view of a string whose lifetime expands across frames. When astring_view
of a temporary string object is passed in (and it is "equal" to one of the strings within the vectordebug_views
), the function silently fails,debug_view
sooner become meaningless and ultimately causes random behavior. I'll suggest a fix about changingdebug_view_ = name;
todebug_view_ = *debugView;
Also,auto debugView = std::find_if(debug_views_.cbegin(), debug_views_.cend(), [this](auto val) { return debug_view_ == val.first; });
seems to not be doing correct validation.