Skip to content

Commit

Permalink
Merge pull request #568 from PeraSite/perasite/fix-diagnostics-dispose
Browse files Browse the repository at this point in the history
Fix diagnostic windows are not updating realtime
  • Loading branch information
hadashiA authored Dec 22, 2023
2 parents c5eb818 + 78d6e78 commit 123d718
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ public void Reload(IObjectResolver resolver)
Repaint();
}

void OnPlayModeStateChange(PlayModeStateChange state)
{
treeView.ReloadAndSort();
Repaint();
}

void OnEnable()
{
window = this; // set singleton.
Expand All @@ -76,11 +82,13 @@ void OnEnable()
searchField = new SearchField();

DiagnositcsContext.OnContainerBuilt += Reload;
EditorApplication.playModeStateChanged += OnPlayModeStateChange;
}

void OnDisable()
{
DiagnositcsContext.OnContainerBuilt -= Reload;
EditorApplication.playModeStateChanged -= OnPlayModeStateChange;
}

void OnGUI()
Expand Down Expand Up @@ -205,4 +213,4 @@ void RenderStackTracePanel()
}
}
}
}
}
8 changes: 8 additions & 0 deletions VContainer/Assets/VContainer/Runtime/Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ public bool TryGetRegistration(Type type, out Registration registration)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Dispose()
{
if (Diagnostics != null)
{
Diagnostics.Clear();
}
disposables.Dispose();
sharedInstances.Clear();
}
Expand Down Expand Up @@ -223,6 +227,10 @@ public void Inject(object instance)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Dispose()
{
if (Diagnostics != null)
{
Diagnostics.Clear();
}
rootScope.Dispose();
disposables.Dispose();
sharedInstances.Clear();
Expand Down

1 comment on commit 123d718

@vercel
Copy link

@vercel vercel bot commented on 123d718 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.