Hi, I have a following question:
I have a modal dialog, in which I would like to perform cleanup of resources, when
dialog is getting closed (something like disconnecting of listeners and so on)
I’m currently doing it in the handler of wx.EVT_CLOSE
Therefore, I have two questions:
- Is it a correct place for doing clean-up of resources, connected to dialog?
- When reading documentation at wx.CloseEvent — wxPython Phoenix 4.2.0 documentation,
it is written, that if CloseEvent can not be vetoed, then dialog should be destroyed or event should be skipped.
At the same time, in the documentation it is written, that one should destroy modal dialog windows, in order to free up underlying operating system resources.
If one tries to call get modal dialog, then the following code is recommended:
dlg = SomeDialog()
result = dlg.ShowModal()
… possibly some processing code for getting results from dialog
dlg.Destroy()
What is getting me confused is the question, is that where does dialog window
is getting destroyed in case, when modal dialog has EVT_CLOSE handler?
What is interaction between destruction of dialog in EVT_CLOSE handler and
in dlg.Destroy()? Where will the dialog be destroyed actually?
Many Thanks in Advance
Serhiy Yevtushenko