Skip to content

Commit 774754e

Browse files
author
Oren (electricessence)
committed
Updates including source referencing.
1 parent 9500f87 commit 774754e

File tree

7 files changed

+33
-26
lines changed

7 files changed

+33
-26
lines changed

AsyncDisposeHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public AsyncDisposeHandler(T value, Func<ValueTask> action) : base(action)
3232

3333
protected override ValueTask OnDisposeAsync()
3434
{
35-
Value = default;
35+
Value = default!;
3636
return base.OnDisposeAsync();
3737
}
3838
}

DeferredCleanupBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ public bool IsRunning
5050
}
5151

5252
private readonly object _timerSync = new object();
53-
private Timer _cleanupTimer;
53+
private Timer? _cleanupTimer;
5454

5555

5656
protected void ResetTimer()
5757
{
58-
Timer ct2;
58+
Timer? ct2;
5959
lock (_timerSync)
6060
{
6161
ct2 = Interlocked.Exchange(ref _cleanupTimer, null);
@@ -138,7 +138,7 @@ public void ClearCleanup()
138138
}
139139
}
140140

141-
private void Cleanup(object state = null)
141+
private void Cleanup(object? state = null)
142142
{
143143
if (WasDisposed)
144144
return; // If another thread enters here after disposal don't allow.

DisposableStateBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected bool AssertIsAlive(bool strict = false)
5656
#region Before Disposal
5757
protected virtual void OnBeforeDispose() { }
5858

59-
private event EventHandler BeforeDisposeInternal;
59+
private event EventHandler? BeforeDisposeInternal;
6060
/// <summary>
6161
/// BeforeDispose will be triggered once right before disposal commences.
6262
/// </summary>
@@ -129,15 +129,15 @@ protected static TNullable Nullify<TNullable>(ref TNullable x)
129129
where TNullable : class
130130
{
131131
var y = x;
132-
x = null;
132+
x = default!;
133133
return y;
134134
}
135135

136136
protected static void DisposeOf<T>(ref T x)
137137
where T : class, IDisposable
138138
{
139139
var y = x;
140-
x = null;
140+
x = default!;
141141
y?.Dispose();
142142
}
143143

DisposeHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public DisposeHandler(T value, Action action) : base(action)
3232

3333
protected override void OnDispose()
3434
{
35-
Value = default;
35+
Value = default!;
3636
base.OnDispose();
3737
}
3838
}
File renamed without changes.

Open.Disposable.csproj

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,31 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
5-
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
6-
<Description>
7-
Provides a set of useful classes when implementing a disposable or dealing with disposables.
8-
9-
Part of the "Open" set of libraries.
10-
</Description>
11-
<Authors>electricessence</Authors>
12-
<Company />
13-
<Product />
5+
<Nullable>enable</Nullable>
6+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
7+
<Authors>electricessence</Authors>
8+
<Description>Provides a set of useful classes when implementing a disposable or dealing with disposables.
9+
10+
Part of the "Open" set of libraries.
11+
</Description>
1412
<PackageTags>dotnet, dotnetcore, cs, idisposable, disposablebase, disposable-pattern, extensions, threadsafe, thread-safe</PackageTags>
15-
<Copyright>https://github.com/electricessence/Open.Disposable/blob/master/LISCENSE.md</Copyright>
16-
<PackageIconUrl></PackageIconUrl>
17-
<PackageProjectUrl>https://github.com/electricessence/Open.Disposable/</PackageProjectUrl>
18-
<RepositoryUrl>https://github.com/electricessence/Open.Disposable/</RepositoryUrl>
13+
<Copyright>https://github.com/Open-NET-Libraries/Open.Disposable/blob/master/LICENSE.md</Copyright>
14+
<PackageProjectUrl>https://github.com/Open-NET-Libraries/Open.Disposable/</PackageProjectUrl>
15+
<RepositoryUrl>https://github.com/Open-NET-Libraries/Open.Disposable/</RepositoryUrl>
1916
<RepositoryType>git</RepositoryType>
20-
<Version>2.3.0</Version>
17+
<Version>2.3.2</Version>
2118
<PackageReleaseNotes></PackageReleaseNotes>
22-
<AssemblyVersion>2.3.0.0</AssemblyVersion>
23-
<FileVersion>2.3.0.0</FileVersion>
2419
<PackageLicenseExpression>MIT</PackageLicenseExpression>
20+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
21+
<IncludeSymbols>true</IncludeSymbols>
22+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
23+
<PackageIcon>logo.png</PackageIcon>
2524
</PropertyGroup>
26-
25+
26+
<ItemGroup>
27+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
28+
</ItemGroup>
29+
2730
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
2831
<LangVersion>latest</LangVersion>
2932
</PropertyGroup>
@@ -36,7 +39,11 @@
3639
<None Remove=".git" />
3740
<None Remove=".gitignore" />
3841
<None Remove="LISCENSE.md" />
39-
<None Remove="README.md" />
42+
<None Remove="README.md"/>
43+
<None Include="logo.png">
44+
<Pack>True</Pack>
45+
<PackagePath></PackagePath>
46+
</None>
4047
</ItemGroup>
4148

4249
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">

logo.png

54.6 KB
Loading

0 commit comments

Comments
 (0)