Hello.
I´ve created a widget. It contains a widget switcher with 2 children (index 0 and 1) and a Button that reset Widget Switcher to Index 0 (This button is not child of the switcher).
Inside Switcher child with index 0 is a button that change active widget index of that switcher to 1, and it works as intended. I can click reset button to change index back to 0 and again click on Button inside a widget switcher to change it again to index 1, and so on.
Problem is, when i close entire widget via another button → Remove From parrent, and reopen widget again, button inside swticher child that supposed change active index dont work.
Debug: I print active widget index on tick, and durring error state it shows 0, even though print string on function that change widget index says index 1.
Another observation: after I close widget and wait a certain amount of time (several seconds), widget switcher works as intended. Until I close it again and that it breaks, again.
I wonder if this is a problem, after closing a widget, there is still reference to old widget somewhere in memory and I must wait for garbage colector to clear it.