|
|
@ -546,11 +546,11 @@ namespace Apewer |
|
|
|
|
|
|
|
/// <summary>执行与释放或重置非托管资源关联的应用程序定义的任务。</summary>
|
|
|
|
/// <returns>可能出现的错误信息。</returns>
|
|
|
|
public static void Dispose(object @object, bool flush = false) |
|
|
|
public static void Dispose(object instance, bool flush = false) |
|
|
|
{ |
|
|
|
if (@object == null) return; |
|
|
|
if (instance == null) return; |
|
|
|
|
|
|
|
var stream = @object as Stream; |
|
|
|
var stream = instance as Stream; |
|
|
|
if (stream != null) |
|
|
|
{ |
|
|
|
if (flush) |
|
|
@ -560,7 +560,7 @@ namespace Apewer |
|
|
|
try { stream.Close(); } catch { } |
|
|
|
} |
|
|
|
|
|
|
|
var disposable = @object as IDisposable; |
|
|
|
var disposable = instance as IDisposable; |
|
|
|
if (disposable != null) |
|
|
|
{ |
|
|
|
try |
|
|
|