From 7d49ea4257b990ef1f6fe87627f185b4377c934e Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 22 Sep 2021 11:05:09 -0700 Subject: [PATCH] -- cambios en dispose --- App_Code/ClsGPS.vb | 15 ++++++++------- App_Code/ClsSisNotificaciones.vb | 18 +++++++++--------- App_Code/ClsVentas.vb | 12 ++++++------ 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/App_Code/ClsGPS.vb b/App_Code/ClsGPS.vb index a16f069eb..790d42e8d 100644 --- a/App_Code/ClsGPS.vb +++ b/App_Code/ClsGPS.vb @@ -5695,18 +5695,19 @@ Public Class ClsGPS If Not disposedValue Then If disposing Then ' TODO: Liberar otro estado (objetos administrados). - If Not Data Is Nothing Then Data.Dispose() + If Not Data Is Nothing Then Data.Dispose() : Data = Nothing If Not Dataset Is Nothing Then Dataset.Clear() Dataset.Dispose() + Dataset = Nothing End If - If Not DtPosiciones Is Nothing Then DtPosiciones.Dispose() - If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() - If Not SqlCommand Is Nothing Then SqlCommand.Dispose() - If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() + If Not DtPosiciones Is Nothing Then DtPosiciones.Dispose() : DtPosiciones = 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() - + If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing + End If ' TODO: Liberar su propio estado (objetos no administrados). diff --git a/App_Code/ClsSisNotificaciones.vb b/App_Code/ClsSisNotificaciones.vb index 4aafd6454..37eb2e654 100644 --- a/App_Code/ClsSisNotificaciones.vb +++ b/App_Code/ClsSisNotificaciones.vb @@ -2066,19 +2066,19 @@ Public Class ClsSisNotificaciones If disposing Then ' TODO: Liberar otro estado (objetos administrados). SqlConexion.Close() - SqlConexion.Dispose() + SqlConexion.Dispose() : SqlConexion = Nothing If Not DataSet Is Nothing Then DataSet.Clear() - DataSet.Dispose() + DataSet.Dispose() : DataSet = Nothing End If - If Not Data Is Nothing Then Data.Dispose() - If Not DTNotificacionesGPS Is Nothing Then DTNotificacionesGPS.Dispose() - If Not DTNotificacionesERP Is Nothing Then DTNotificacionesERP.Dispose() - If Not DTNotificacionesArmadas Is Nothing Then DTNotificacionesArmadas.Dispose() - If Not DTReportesProgramados Is Nothing Then DTReportesProgramados.Dispose() + If Not Data Is Nothing Then Data.Dispose() : Data = Nothing + If Not DTNotificacionesGPS Is Nothing Then DTNotificacionesGPS.Dispose() : DTNotificacionesGPS = Nothing + If Not DTNotificacionesERP Is Nothing Then DTNotificacionesERP.Dispose() : DTNotificacionesERP = Nothing + If Not DTNotificacionesArmadas Is Nothing Then DTNotificacionesArmadas.Dispose() : DTNotificacionesArmadas = Nothing + If Not DTReportesProgramados Is Nothing Then DTReportesProgramados.Dispose() : DTNotificacionesGPS = Nothing NotificacionesBitacora = "" - If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() - If Not SqlCommand Is Nothing Then SqlCommand.Dispose() + If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing + If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing End If ' TODO: Liberar su propio estado (objetos no administrados). diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index c8a9c42e7..cee7e3770 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -5257,13 +5257,13 @@ Public Class ClsVentas If Not Me.disposedValue Then If disposing Then ' TODO: dispose managed state (managed objects). - If Not Data Is Nothing Then Data.Dispose() - If Not Dataset Is Nothing Then Dataset.Dispose() - If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() - If Not SqlCommand Is Nothing Then SqlCommand.Dispose() - If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() + If Not Data Is Nothing Then Data.Dispose() : Data = Nothing + If Not Dataset Is Nothing Then Dataset.Dispose() : Dataset = 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() + If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing End If ' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.