Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public void SetGameView()
{
GameMode.SetPlayWidget( Renderer );
IsGameView = true;
Tools.DisposeAll();
}

/// <summary>
Expand Down Expand Up @@ -83,5 +84,6 @@ public void OnPossessGame()
{
GameMode.SetPlayWidget( Renderer );
IsGameView = true;
Tools.DisposeAll();
}
}
8 changes: 8 additions & 0 deletions game/addons/tools/Code/Scene/Tools/EditorToolManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@ private void CreateToolFor( Type t )
}
}

public void DisposeAll()
{
previousHash = -1;
foreach ( var tool in ComponentTools )
tool?.Dispose();
ComponentTools.Clear();
}

/// <summary>
/// Switches to the named tool type next editor frame.
/// </summary>
Expand Down