Skip to content

Commit

Permalink
Mono.Dispose() checks if monoChannel is IDisposable #2
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriiKh committed Aug 31, 2020
1 parent 63a7d75 commit ce57161
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CarefulAudioRepair/Data/Mono.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,13 @@ public double[] GetOutputArray(ChannelType channelType)
}

/// <inheritdoc/>
public void Dispose() => this.monoChannel.Dispose();
public void Dispose()
{
if (this.monoChannel is IDisposable channel)
{
channel.Dispose();
}
}

/// <inheritdoc/>
public double[] GetInputRange(ChannelType channelType, int start, int length)
Expand Down

0 comments on commit ce57161

Please sign in to comment.