# On editor exit play mode

**URL:** <https://forums.unrealengine.com/t/on-editor-exit-play-mode/312707>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [March 26, 2015, 4:05pm UTC](https://forums.unrealengine.com/t/on-editor-exit-play-mode/312707 "2015-03-26T16:05:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elringus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/elringus/32/1017568_2.png) [@Elringus](https://forums.unrealengine.com/u/Elringus)\
**Post date:** [March 26, 2015, 4:05pm UTC](https://forums.unrealengine.com/t/on-editor-exit-play-mode/312707/1 "2015-03-26T16:05:09Z")

</div>

I wonder if there is some event or a virtual function being called when the editor exits play mode (stops simulation). What I need is to clear my custom events invocation lists at that time. They are kept in the static class, so it continues to live even after the editor stops simulation, therefore bringing problems on sequential simulations.

---

<div class="post-metadata">

**Author:** ![ruohki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ruohki](https://forums.unrealengine.com/u/ruohki)\
**Post date:** [April 6, 2015, 10:14pm UTC](https://forums.unrealengine.com/t/on-editor-exit-play-mode/312707/2 "2015-04-06T22:14:12Z")

</div>

If you do c++ you can implement the BeginDestroy() and do Class specific stuff there

---

<div class="post-metadata">

**Author:** ![Elringus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/elringus/32/1017568_2.png) [@Elringus](https://forums.unrealengine.com/u/Elringus)\
**Post date:** [April 6, 2015, 10:29pm UTC](https://forums.unrealengine.com/t/on-editor-exit-play-mode/312707/3 "2015-04-06T22:29:26Z")

</div>

The class I was talking about was a Slate widget, so it doesn’t have the BeginDestroy method, as it is not inherited from UObject. (I was not clear about that in my question — my mistake)

However, in my case the solution was a trivial one: I’ve just used the default class destructor to remove delegates, and it worked fine.

Nevertheless, in case it’s a some subclass of an UObject — I assume your answer is correct, so I will accept it. Thanks!
