Skip to content

Commit

Permalink
fix (mvTheme): Pop must be done in the reverse order of push.
Browse files Browse the repository at this point in the history
This is needed to properly restore _specificComponentPtr back when there are multiple components with the same specificType.
  • Loading branch information
v-ein committed Feb 8, 2025
1 parent e2da9f5 commit ffb382f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mvThemes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ void mvTheme::push_theme_components()
void mvTheme::pop_theme_components()
{

for (auto& child : childslots[1])
for (auto it = childslots[1].rbegin(); it != childslots[1].rend(); it++)
{
auto comp = static_cast<mvThemeComponent*>(child.get());
auto comp = static_cast<mvThemeComponent*>(it->get());
if (comp->_specificType == (int)mvAppItemType::All || comp->_specificType == _specificType)
{
if (_specificEnabled == comp->_specificEnabled)
Expand Down

0 comments on commit ffb382f

Please sign in to comment.