C
cody
MyDlg dlg = new MyDlg();
dlg.ShowDialog();
after the dialog is closed here I expected that Form.Dispose would be called
but this isn't the case.
Why? After closing the application, Dispose was called.
I had a very funny bug because of this: I run a System.Windows.Forms.Timer
in this dialog and expected it would be stopped & disposed after the dialog
was closed but this was not the case. It continued running after the dialog
was closed and at the end I had multiple instances of this dialog in memory
with their timers running but neither of them was visible and they did
funny things in my app.
dlg.ShowDialog();
after the dialog is closed here I expected that Form.Dispose would be called
but this isn't the case.
Why? After closing the application, Dispose was called.
I had a very funny bug because of this: I run a System.Windows.Forms.Timer
in this dialog and expected it would be stopped & disposed after the dialog
was closed but this was not the case. It continued running after the dialog
was closed and at the end I had multiple instances of this dialog in memory
with their timers running but neither of them was visible and they did
funny things in my app.