Fixed: DataMapper potentially leaking stuff when being disposed.

Leonardo Galli 6 years ago
parent 8e7b718209
commit 09899fcf6c

@ -941,21 +941,21 @@ namespace Marr.Data
{ {
if (disposing) if (disposing)
{ {
if (Command.Transaction != null) if (_command != null)
{ {
Command.Transaction.Dispose(); if (_command.Transaction != null)
Command.Transaction = null; {
} _command.Transaction.Dispose();
_command.Transaction = null;
}
if (Command.Connection != null) if (_command.Connection != null)
{ {
Command.Connection.Dispose(); _command.Connection.Dispose();
Command.Connection = null; _command.Connection = null;
} }
if (Command != null) _command.Dispose();
{
Command.Dispose();
_command = null; _command = null;
} }
} }

Loading…
Cancel
Save