Skip to content

Commit 748098e

Browse files
authored
Merge pull request #48 from synercoder/develop
Fixed memory buildup
2 parents 0e318fe + 69f3128 commit 748098e

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

.github/workflows/dotnet-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: dotnet test -c Release
4343
- name: Pack
4444
if: matrix.os == 'ubuntu-latest'
45-
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
45+
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
4646
- name: Upload Artifact
4747
if: matrix.os == 'ubuntu-latest'
4848
uses: actions/upload-artifact@v2

src/Synercoding.FileFormats.Pdf/Internals/Map.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ public void Add(T1 t1, T2 t2)
2525
_reverse.Add(t2, t1);
2626
}
2727

28+
public void Clear()
29+
{
30+
_forward.Clear();
31+
_reverse.Clear();
32+
}
33+
2834
public IEnumerator<KeyValuePair<T1, T2>> GetEnumerator()
2935
{
3036
return _forward.GetEnumerator();

src/Synercoding.FileFormats.Pdf/LowLevel/PageResources.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public void Dispose()
1717
{
1818
foreach (var kv in _images)
1919
kv.Value.Dispose();
20+
21+
_images.Clear();
2022
}
2123

2224
public PdfName AddImageToResources(Image image)

src/Synercoding.FileFormats.Pdf/PackageDetails.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Product>Synercoding.FileFormats.Pdf</Product>
1111
<Title>Synercoding.FileFormats.Pdf</Title>
1212
<Description>Contains classes which makes it easy to quickly create a pdf file.</Description>
13-
<PackageReleaseNotes>Added support for the drawing of shapes.</PackageReleaseNotes>
13+
<PackageReleaseNotes>Fixed a memory buildup bug by clearing the dictionary that contained the image references on dispose.</PackageReleaseNotes>
1414
</PropertyGroup>
1515

1616
</Project>

0 commit comments

Comments
 (0)