Add warning to ButtonSet::addItem() which is not safe to use w/a non-string literal

This commit is contained in:
David Capello 2023-02-27 11:57:56 -03:00
parent d88eb80fe6
commit 672f371622

View File

@ -239,6 +239,9 @@ ButtonSet::Item* ButtonSet::addItem(Item* item, const char* styleId)
ButtonSet::Item* ButtonSet::addItem(Item* item, int hspan, int vspan, const char* styleId)
{
// TODO warning, here we're saving a copy of the styleId pointer,
// which if it's not a literal that lives enough for this
// lambda, it will crash the program
item->InitTheme.connect(
[item, styleId] {
ui::Style* style;