# Shutdown Script Management

Editor Shutdown is less involved than Editor Startup, we just need a function to connect to the callback is all:

```python
def on_editor_shutdown():
    print("Running Editor Shutdown code")
    
    
shutdown_id = unreal.register_python_shutdown_callback(on_editor_shutdown)
```

{% hint style="danger" %}
While the implementation is simple, the Editor state is incredibly limited when our hook gets called, it's best to assume that any Editor Utility Widgets and general Editor Tools have already been closed by Unreal by the time our function gets called
{% endhint %}
