PgSqlDataTable Disposing Failed
Posted: Sun 21 Aug 2016 08:38
Hello,
i have 2 Forms (Form1 and Form2).
In Form1 i create a new Form2 with a click on a button and dispose that form with another button:
Form2 has an Timer and PgSqlDataTable component placed on it:
Form 2 also introduces the disposing events for both the Timer and the SqlDataTable:
However when i dispose the Form2 in Form1 (button2_Click) only the Timer gets disposed and the message shown.
Could it be that SqlDataTable doesn't get disposed correctly?!
Thanks.
i have 2 Forms (Form1 and Form2).
In Form1 i create a new Form2 with a click on a button and dispose that form with another button:
Code: Select all
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private Form _form;
private void button1_Click(object sender, EventArgs e)
{
_form = new Form2();
_form.Show();
}
private void button2_Click(object sender, EventArgs e)
{
_form.Dispose();
}
}
Form2 has an Timer and PgSqlDataTable component placed on it:
Form 2 also introduces the disposing events for both the Timer and the SqlDataTable:
Code: Select all
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
timer1.Disposed += delegate { MessageBox.Show("timer1 - Disposed"); };
pgSqlDataTable1.Disposed += delegate { MessageBox.Show("pgSqlDataTable1 - Disposed"); };
}
}
Could it be that SqlDataTable doesn't get disposed correctly?!
Thanks.