Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #187 from pharos/actvity-source-leak
Browse files Browse the repository at this point in the history
fixes #184
  • Loading branch information
baywet authored Jan 9, 2024
2 parents 40262ef + 366b9b8 commit 39b329d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.3.4] - 2023-12-29

### Added

- Fixes `ActicitySource` memory leak when the HttpClientRequestAdapter does not construct the HttpClient internally.

## [1.3.3] - 2023-11-28

### Added
Expand Down
3 changes: 1 addition & 2 deletions src/HttpClientRequestAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public HttpClientRequestAdapter(IAuthenticationProvider authenticationProvider,
pNodeFactory = parseNodeFactory ?? ParseNodeFactoryRegistry.DefaultInstance;
sWriterFactory = serializationWriterFactory ?? SerializationWriterFactoryRegistry.DefaultInstance;
obsOptions = observabilityOptions ?? new ObservabilityOptions();
activitySource = new(obsOptions.TracerInstrumentationName);
activitySource = ActivitySourceRegistry.DefaultInstance.GetOrCreateActivitySource(obsOptions.TracerInstrumentationName);
}
/// <summary>Factory to use to get a serializer for payload serialization</summary>
public ISerializationWriterFactory SerializationWriterFactory
Expand Down Expand Up @@ -603,7 +603,6 @@ protected virtual void Dispose(bool disposing)
// Cleanup
if(createdClient)
{
activitySource?.Dispose();
client?.Dispose();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Kiota.Http.HttpClientLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageProjectUrl>https://aka.ms/kiota/docs</PackageProjectUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<Deterministic>true</Deterministic>
<VersionPrefix>1.3.3</VersionPrefix>
<VersionPrefix>1.3.4</VersionPrefix>
<VersionSuffix></VersionSuffix>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<!-- Enable this line once we go live to prevent breaking changes -->
Expand Down

0 comments on commit 39b329d

Please sign in to comment.