Skip to content

Commit

Permalink
Final tweaks for Dispose issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tippmar-nr committed Jul 18, 2023
1 parent da7f99a commit 6d09a01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Agent/NewRelic/Agent/Core/Samplers/GCSamplerNetCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public override void Dispose()
{
base.Dispose();
_listener?.StopListening();
//_listener?.Dispose();
_listener?.Dispose();
_listener = null;
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/Agent/NewRelic/Agent/Core/Samplers/ThreadStatsSampler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public override void Dispose()
{
base.Dispose();
_listener?.StopListening();
//_listener?.Dispose();
#if NETFRAMEWORK // calling .Dispose() in .NET 7 explodes. No idea why.
_listener?.Dispose();
#endif
_listener = null;
}
}
Expand Down

0 comments on commit 6d09a01

Please sign in to comment.