CommonUI ActivatableWidget OwningPlayer not set on the second PIE session

Now that’s an helpful community, no wonder there’s no documentation anywhere, donno if it’s just because nobody cares or if it’s gatekeeping but whatever. I have solved my issue after plenty of headache. For safekeeping if anyone ever find themselves into a similar situation…

I have continued to search, keeping on that path of “The IDE does keep stuff between PIE sessions”, I stumbled on some posts talking about Online Subsystems doing something similar, I understood I was on the right path. After a couple unsuccessful attempts, a meltdown where I said **** that i’ll solve it another day, and a stroke of genius in the shower, I have succeeded.

The issue is in CommonUI’s UCommonActivatableWidgetStack’s behavior of pooling widgets to reuse them, and the fact that my Data Asset holds a TObjectPtr<> of my layout blueprint. That object apparently was kept in memory, which means the stack’s cached widgets did too. GetOwningPlayer was wrong because the OwningPlayer reference was from the first session, and that object doesn’t exist anymore. I solved my issue by changing the TObjectPtr<> to a TSubclassOf<> and I CreateWidget() it instead.