Hi, I got a strange problem and I think it's related to wxPython ... I open my application and then I start my dialog (a subclass of wx.Dialog). All works fine, but ater closing the main application the process pythonw.exe remains on the task manager, and it does not close correctly. I don't use any thread, and my app behave like that only if I open the dialog, instead it closes correctly.
My dialog is shown using ShowModal, and I got 2 buttons that uses EndModal to close it.
On Fri, 20 Aug 2004 10:31:40 +0200, Gabriele Farina *DarkBard* <darkbard@extending-php.net> wrote:
Hi, I got a strange problem and I think it's related to wxPython ... I open my application and then I start my dialog (a subclass of wx.Dialog). All works fine, but ater closing the main application the process pythonw.exe remains on the task manager, and it does not close correctly. I don't use any thread, and my app behave like that only if I open the dialog, instead it closes correctly.
My dialog is shown using ShowModal, and I got 2 buttons that uses EndModal to close it.
If I call dlg.Destroy(), my application stops catching events, end then exits generating a Windows error ...
It seems I can't destroy the dialog, but I don't know why ...
Your application hangs "does not close correctly" because it cannot free some resources.
Being unable to call dlg.Destroy() gives you a hint about the problem. If you cannot free the resources taken by the dialog you will not be able to close the application correctly.
So... the error might be located in the dialog code.
If posible attach the dialog code.
···
On Fri, 20 Aug 2004 15:10:30 +0200, Gabriele Farina *DarkBard* <darkbard@extending-php.net> wrote:
did you call dlg.Destroy() ?
Hi,
If I call dlg.Destroy(), my application stops catching events, end then exits generating a Windows error ...
It seems I can't destroy the dialog, but I don't know why ...
Your application hangs "does not close correctly" because it cannot free some resources.
Being unable to call dlg.Destroy() gives you a hint about the problem. If you cannot free the resources taken by the dialog you will not be able to close the application correctly.
So... the error might be located in the dialog code.
If posible attach the dialog code.
The dialog code is too long to be posted ... but I solved my problem using this trick:
class MyDialog(wx.Dialog):
[...]
def __del__(self):
self.Destroy()
and after calling MyDialogInstance.ShowModal() I use:
del MyDialogInstance
Now It free all the resources correctly ... if I use MyDialogInstance.Destroy() instead of explicit deletation, the program freezes ...