cambio de lugar de dispose

This commit is contained in:
2021-09-24 12:18:02 -07:00
parent 25dd8a6515
commit cf0f9b5ebe

View File

@@ -6229,30 +6229,6 @@ Public Class ClsContabilidad
#End Region
#Region "IDisposable Support"
' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
If Not DSet Is Nothing Then DSet.Dispose() : DSet = Nothing
If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing
End If
End If
Me.disposedValue = True
End Sub
Public Sub Dispose() Implements IDisposable.Dispose
ConexionClose()
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region
#Region "Periodos Bloqueo Meses"
Public Function GetPeriodosBloqueo(CveEmpresa As Integer) As Boolean
Dim Retorno = False
@@ -6376,8 +6352,6 @@ Public Class ClsContabilidad
End Function
#End Region
#Region "ESTADO RESULTADOS HORIZONTAL"
@@ -6567,4 +6541,32 @@ Public Class ClsContabilidad
Return Retorno
End Function
#Region "IDisposable Support"
' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
If Not Data Is Nothing Then Data.Dispose() : Data = Nothing
If Not DSet Is Nothing Then DSet.Dispose() : DSet = Nothing
If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing
If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing
If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing
If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing
End If
End If
Me.disposedValue = True
End Sub
Public Sub Dispose() Implements IDisposable.Dispose
ConexionClose()
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region
End Class