mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-08-04 04:47:58 +08:00
debug Destructor #131
This commit is contained in:
@ -3,6 +3,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql
|
||||
@ -42,11 +43,10 @@ namespace FreeSql
|
||||
}
|
||||
|
||||
~BaseRepository() => this.Dispose();
|
||||
bool _isdisposed = false;
|
||||
int _disposeCounter;
|
||||
public void Dispose()
|
||||
{
|
||||
if (_isdisposed) return;
|
||||
_isdisposed = true;
|
||||
if (Interlocked.Increment(ref _disposeCounter) != 1) return;
|
||||
try
|
||||
{
|
||||
_dbsetPriv?.Dispose();
|
||||
|
Reference in New Issue
Block a user