mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 20:38:16 +08:00
debug Destructor #131
This commit is contained in:
@ -120,14 +120,11 @@ namespace FreeSql.Internal.CommonProvider
|
||||
}
|
||||
}
|
||||
|
||||
~AdoProvider()
|
||||
{
|
||||
this.Dispose();
|
||||
}
|
||||
bool _isdisposed = false;
|
||||
~AdoProvider() => this.Dispose();
|
||||
int _disposeCounter;
|
||||
public void Dispose()
|
||||
{
|
||||
if (_isdisposed) return;
|
||||
if (Interlocked.Increment(ref _disposeCounter) != 1) return;
|
||||
try
|
||||
{
|
||||
Transaction2[] trans = null;
|
||||
|
@ -10,6 +10,7 @@ using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql.Internal.CommonProvider
|
||||
@ -38,11 +39,10 @@ namespace FreeSql.Internal.CommonProvider
|
||||
protected List<LambdaExpression> _whereCascadeExpression = new List<LambdaExpression>();
|
||||
protected List<GlobalFilter.Item> _whereGlobalFilter;
|
||||
|
||||
bool _isDisponse = false;
|
||||
int _disposeCounter;
|
||||
~Select0Provider()
|
||||
{
|
||||
if (_isDisponse) return;
|
||||
_isDisponse = false;
|
||||
if (Interlocked.Increment(ref _disposeCounter) != 1) return;
|
||||
_where.Clear();
|
||||
_params.Clear();
|
||||
_tables.Clear();
|
||||
|
Reference in New Issue
Block a user