Do not Dispose on finalize (might be already finalized)
This commit is contained in:
1 parent
c23eaa0834
commit
fc278e4ad9
1 file changed
+4
-4
@@ -45,7 +45,7 @@ namespace Vocaluxe.Lib.Sound.Record
|
||||
|
||||
~CBuffer()
|
||||
{
|
||||
_Dispose();
|
||||
_Dispose(false);
|
||||
}
|
||||
|
||||
public int GetNumHalfTones()
|
||||
@@ -110,13 +110,13 @@ namespace Vocaluxe.Lib.Sound.Record
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_Dispose();
|
||||
_Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
private void _Dispose()
|
||||
private void _Dispose(bool disposing)
|
||||
{
|
||||
if (_PitchTracker != null)
|
||||
if (disposing && _PitchTracker != null)
|
||||
{
|
||||
_PitchTracker.Dispose();
|
||||
_PitchTracker = null;
|
||||
|
||||
Reference in new issue
Block a user