File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,12 +71,12 @@ void mvTheme::push_theme_components()
7171 {
7272 if (_specificEnabled == comp->_specificEnabled )
7373 {
74- comp->_oldComponent = *comp->_specificComponentPtr ;
74+ comp->_oldComponent = std::move ( *comp->_specificComponentPtr ) ;
7575 *comp->_specificComponentPtr = *(std::shared_ptr<mvThemeComponent>*) & child;
7676 }
7777 else
7878 {
79- comp->_oldComponent = *comp->_specificDisabledComponentPtr ;
79+ comp->_oldComponent = std::move ( *comp->_specificDisabledComponentPtr ) ;
8080 *comp->_specificDisabledComponentPtr = *(std::shared_ptr<mvThemeComponent>*) & child;
8181 }
8282 }
@@ -100,11 +100,13 @@ void mvTheme::pop_theme_components()
100100 {
101101 if (_specificEnabled == comp->_specificEnabled )
102102 {
103- *comp->_specificComponentPtr = comp->_oldComponent ;
103+ // Nullifying comp->_oldComponent to avoid mvThemeComponent
104+ // hanging around even after being deleted from the widget tree.
105+ *comp->_specificComponentPtr = std::move (comp->_oldComponent );
104106 }
105107 else
106108 {
107- *comp->_specificDisabledComponentPtr = comp->_oldComponent ;
109+ *comp->_specificDisabledComponentPtr = std::move ( comp->_oldComponent ) ;
108110 }
109111
110112 }
You can’t perform that action at this time.
0 commit comments