MediaInfo Dispose only when handle was created.

This commit is contained in:
Taloth Saldono 2015-06-27 01:01:53 +02:00
parent c9f720885e
commit c4430ab4de
1 changed files with 8 additions and 2 deletions

View File

@ -72,13 +72,19 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
}
~MediaInfo()
{
if (_handle != IntPtr.Zero)
{
MediaInfo_Delete(_handle);
}
}
public void Dispose()
{
if (_handle != IntPtr.Zero)
{
MediaInfo_Delete(_handle);
}
GC.SuppressFinalize(this);
}