The 'disposing' parameter of Dispose() virtual method is also
used for its implementation according to the common usage.
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
public void Dispose()
{
Dispose(true);
+ GC.SuppressFinalize(this);
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void Dispose(bool disposing)
{
- if (!_disposed)
+ if (_disposed)
+ {
+ return;
+ }
+
+ if (disposing)
{
ReplaceDisplay(null);
try
{
_source.DetachFrom(this);
+ _source = null;
}
catch (Exception e)
{
Log.Error(PlayerLog.Tag, e.ToString());
}
}
- _source = null;
if (_handle != null)
{
_handle.Dispose();
+ _disposed = true;
}
- _disposed = true;
}
}