I have a form CommanderForm which open and closes TCP connection and open SWRCTStatePageForm. If I firstly open SWRCTStatePageForm and then open TCP connection in CommanderForm and after that close SWRCTStatePageForm i get an error: "System.ObjectDisposedException: "Доступ к ликвидированному объекту невозможен." in line:   Invoke(new Action(() =>
                    MessageBox.Show($"Ошибка Modbus соединения: {ex.Message}", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error)
                ));


How to fix it?

Code:
using NModbus.Device;
using ModBusHelper;
using NModbus;
using System;
using System.Data;
using System.Net.Sockets;
using System.Windows.Forms;
using System.ComponentModel;

namespace Configurator
{
    public partial class SWRCTStatePageForm : Form
    {
        CommanderForm CommanderForm;
        private BackgroundWorker BackgroundWork = new BackgroundWorker();
        private DataTable cntvDataTable = new DataTable();

        private ModBusProfile ModBusProfileHelper = new ModBusProfile();
        private ModBusExporterLinker ExporterLinkerHelper = new ModBusExporterLinker();

        private Tuple<TcpClient, IModbusMaster> _connection;

        public SWRCTStatePageForm(CommanderForm CommanderFormInstance)
        {
            InitializeComponent();
            this.CommanderForm = CommanderFormInstance;

            // Subscribe to events from the CommanderForm
            CommanderForm.ConnectionStarted += OnConnectionStarted;
            CommanderForm.ConnectionStopped += OnConnectionStopped;

            InitializeDataTable();
            InitializeBackgroundWorker();

            // Check if the connection is already active
            var existingConnection = CommanderForm.GetCurrentConnection();
            if (existingConnection != null && existingConnection.Item1.Connected)
            {
                OnConnectionStarted(existingConnection);
            }
        }

        private void InitializeDataTable()
        {
            ModBusProfile.ssp ssp = ExporterLinkerHelper.ssp_Default;

            ste1TextBox.Text = ssp.ste[0].ToString();
            ste2TextBox.Text = ssp.ste[1].ToString();
            ste3TextBox.Text = ssp.ste[2].ToString();
            ste4TextBox.Text = ssp.ste[3].ToString();

            cntvDataTable.Columns.Add("Канал", typeof(int));
            cntvDataTable.Columns.Add("Накопленное значение расхода ресурса (%)", typeof(float));
            cntvDataTable.Columns.Add("Количество отключений", typeof(ushort));
            cntvDataTable.Columns.Add("Количество включений", typeof(ushort));
            cntvDataTable.Rows.Add(new object[] { 0, ssp.cntv[0].Racc, ssp.cntv[0].ofcnt, ssp.cntv[0].oNacnt });
            cntvDataGridView.DataSource = cntvDataTable;
        }

        private void InitializeBackgroundWorker()
        {
            BackgroundWork.WorkerSupportsCancellation = true;
            BackgroundWork.DoWork += BackgroundWork_DoWork;
        }

        private void OnConnectionStarted(Tuple<TcpClient, IModbusMaster> connection)
        {
            _connection = connection;
            if (!BackgroundWork.IsBusy)
            {
                BackgroundWork.RunWorkerAsync(argument: _connection);
            }
        }

        private void OnConnectionStopped()
        {
            if (BackgroundWork.IsBusy)
            {
                BackgroundWork.CancelAsync();
            }
        }

        private void BackgroundWork_DoWork(object sender, DoWorkEventArgs e)
        {
            var connection = e.Argument as Tuple<TcpClient, IModbusMaster>;

            if (connection == null)
            {
                Invoke(new Action(() =>
                    MessageBox.Show("Ошибка соединения", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error)
                ));
                return;
            }

            TcpClient tcpClient = connection.Item1;
            IModbusMaster modbusMaster = connection.Item2;

            try
            {
                while (!e.Cancel)
                {
                    if ((sender as BackgroundWorker).CancellationPending)
                    {
                        e.Cancel = true;
                        break;
                    }

                    ModBusProfile.ssp sspValues = ModBusProfileHelper.swrct_state_page_Read(modbusMaster);

                    Invoke(new Action(() =>
                    {
                        ste1TextBox.Text = sspValues.ste[0].ToString();
                        ste2TextBox.Text = sspValues.ste[1].ToString();
                        ste3TextBox.Text = sspValues.ste[2].ToString();
                        ste4TextBox.Text = sspValues.ste[3].ToString();

                        UpdateCntvDataTable(sspValues);
                    }));

                    System.Threading.Thread.Sleep(1000);
                }
            }
            catch (Exception ex)
            {
                Invoke(new Action(() =>
                    MessageBox.Show($"Ошибка Modbus соединения: {ex.Message}", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error)
                ));
            }
        }

        private void UpdateCntvDataTable(ModBusProfile.ssp sspValues)
        {
            while (sspValues.cntv.Length > cntvDataTable.Rows.Count)
            {
                cntvDataTable.Rows.Add(new object[] { cntvDataTable.Rows.Count, 0, 0, 0 });
            }
            while (sspValues.cntv.Length < cntvDataTable.Rows.Count)
            {
                cntvDataTable.Rows.RemoveAt(cntvDataTable.Rows.Count - 1);
            }

            for (int z = 0; z < sspValues.cntv.Length; z++)
            {
                cntvDataTable.Rows[z][1] = sspValues.cntv[z].Racc;
                cntvDataTable.Rows[z][2] = sspValues.cntv[z].ofcnt;
                cntvDataTable.Rows[z][3] = sspValues.cntv[z].oNacnt;
            }

            cntvDataGridView.DataSource = cntvDataTable;
        }

        private void SWRCTStatePageForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (BackgroundWork.WorkerSupportsCancellation)
            {
                BackgroundWork.CancelAsync();
            }

            CommanderForm.ConnectionStarted -= OnConnectionStarted;
            CommanderForm.ConnectionStopped -= OnConnectionStopped;
        }
    }
}