how to check end of the game

Hi, I have a class A inherited from SCompoundWidget.
In my class A, I want to check end of the game.(playing).
So when the game is shutdown, I can destroy the UI windows that I create in class A.

I tried to use Shutdown() (UGameInstance::Shutdown | Unreal Engine Documentation) but when I build, cannot override shutdown function.

Thanks for your time!

Not sure, but you can try to use virtual Destructor of SWidget (SCompoundWidget is not overriding it)

virtual ~SWidget();