mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
debug Destructor #131
This commit is contained in:
@ -4,6 +4,7 @@ using FreeSql.Sqlite.Curd;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Threading;
|
||||
|
||||
namespace FreeSql.Sqlite
|
||||
{
|
||||
@ -46,14 +47,11 @@ namespace FreeSql.Sqlite
|
||||
|
||||
public GlobalFilter GlobalFilter { get; } = new GlobalFilter();
|
||||
|
||||
~SqliteProvider()
|
||||
{
|
||||
this.Dispose();
|
||||
}
|
||||
bool _isdisposed = false;
|
||||
~SqliteProvider() => this.Dispose();
|
||||
int _disposeCounter;
|
||||
public void Dispose()
|
||||
{
|
||||
if (_isdisposed) return;
|
||||
if (Interlocked.Increment(ref _disposeCounter) != 1) return;
|
||||
(this.Ado as AdoProvider)?.Dispose();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user