Skip to content

Commit

Permalink
Merge pull request #48 from synercoder/develop
Browse files Browse the repository at this point in the history
Fixed memory buildup
  • Loading branch information
synercoder authored Aug 24, 2022
2 parents 0e318fe + 69f3128 commit 748098e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: dotnet test -c Release
- name: Pack
if: matrix.os == 'ubuntu-latest'
run: dotnet pack -v normal -c Release --no-restore --include-symbols --include-source -p:SymbolPackageFormat=snupkg -p:PackageVersion=$GITHUB_RUN_ID-pre src/$PROJECT_NAME/$PROJECT_NAME.*proj
run: dotnet pack -v normal -c Release --no-restore --include-symbols --include-source -p:SymbolPackageFormat=snupkg -p:PackageVersion=1.0.0-pre+$GITHUB_RUN_ID src/$PROJECT_NAME/$PROJECT_NAME.*proj
- name: Upload Artifact
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v2
Expand Down
6 changes: 6 additions & 0 deletions src/Synercoding.FileFormats.Pdf/Internals/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ public void Add(T1 t1, T2 t2)
_reverse.Add(t2, t1);
}

public void Clear()
{
_forward.Clear();
_reverse.Clear();
}

public IEnumerator<KeyValuePair<T1, T2>> GetEnumerator()
{
return _forward.GetEnumerator();
Expand Down
2 changes: 2 additions & 0 deletions src/Synercoding.FileFormats.Pdf/LowLevel/PageResources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public void Dispose()
{
foreach (var kv in _images)
kv.Value.Dispose();

_images.Clear();
}

public PdfName AddImageToResources(Image image)
Expand Down
2 changes: 1 addition & 1 deletion src/Synercoding.FileFormats.Pdf/PackageDetails.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Product>Synercoding.FileFormats.Pdf</Product>
<Title>Synercoding.FileFormats.Pdf</Title>
<Description>Contains classes which makes it easy to quickly create a pdf file.</Description>
<PackageReleaseNotes>Added support for the drawing of shapes.</PackageReleaseNotes>
<PackageReleaseNotes>Fixed a memory buildup bug by clearing the dictionary that contained the image references on dispose.</PackageReleaseNotes>
</PropertyGroup>

</Project>

0 comments on commit 748098e

Please sign in to comment.