# how to check end of the game

**URL:** <https://forums.unrealengine.com/t/how-to-check-end-of-the-game/473326>\
**Category:** UI\
**Tags:** Gameplay, gameinstance, unreal-engine, UI, question\
**Created:** [October 22, 2020, 6:44pm UTC](https://forums.unrealengine.com/t/how-to-check-end-of-the-game/473326 "2020-10-22T18:44:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_ef9e6d841](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ef9e6d841](https://forums.unrealengine.com/u/anonymous_user_ef9e6d841)\
**Post date:** [October 22, 2020, 6:44pm UTC](https://forums.unrealengine.com/t/how-to-check-end-of-the-game/473326/1 "2020-10-22T18:44:05Z")

</div>

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](https://docs.unrealengine.com/en-US/API/Runtime/Engine/Engine/UGameInstance/Shutdown/index.html)) but when I build, cannot override shutdown function.

Thanks for your time!

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [October 23, 2020, 5:57pm UTC](https://forums.unrealengine.com/t/how-to-check-end-of-the-game/473326/2 "2020-10-23T17:57:30Z")

</div>

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

```
virtual ~SWidget();
```
