Remove bindings for InputEvent and InputAxis on dispose.

This commit is contained in:
Chandler Cox
2024-08-21 12:48:46 -05:00
parent d779862271
commit 6b0098bb09
2 changed files with 10 additions and 0 deletions

View File

@@ -60,6 +60,7 @@ namespace FlaxEngine
~InputAxis()
{
Input.AxisValueChanged -= Handler;
ValueChanged = null;
}
/// <summary>
@@ -68,6 +69,7 @@ namespace FlaxEngine
public void Dispose()
{
Input.AxisValueChanged -= Handler;
ValueChanged = null;
GC.SuppressFinalize(this);
}