> For the complete documentation index, see [llms.txt](https://docs.oserosuite.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oserosuite.com/technical-notes/unreal-engine-notes/editor-engine/exit-fcoredelegates.md).

# Exit FCoreDelegates

```cpp
// Called when the application is about to exit.
static CORE_API FSimpleMulticastDelegate OnExit;

// Called when before the application is exiting.
static CORE_API FSimpleMulticastDelegate OnPreExit;

// Called before the engine exits. Separate from OnPreExit as OnEnginePreExit occurs before shutting down any core modules.
static CORE_API FSimpleMulticastDelegate OnEnginePreExit;
```

### Example

(From SHADERSOURCE: Texture Tools)

```cpp
FCoreDelegates::OnEnginePreExit.AddRaw(this, &FShadersource_TextureToolsModule::OnEditorClose);
```

```cpp
void FShadersource_TextureToolsModule::OnEditorClose()
{
	if (ToolWidget.IsValid())
	{
		ToolWidget.Reset();
	}
}
```
