Destroy for wxDialog based window
Posted: Sun Feb 08, 2009 4:57 pm
Hi all,
i am trying to destroy a wxDialog based object using "Destroy" inside OnCancel.
My first question is, is it necessary ? I can't find a clear answer in the documentation, but i want be sure the memory allocated from the dialog object is released, and don't seems that clicking on the [X] destroy/free the object.
Anyway, using "Destroy" inside OnCancel, the program crash, this is the call stack:
any help is really appreciated,
many thanks
i am trying to destroy a wxDialog based object using "Destroy" inside OnCancel.
My first question is, is it necessary ? I can't find a clear answer in the documentation, but i want be sure the memory allocated from the dialog object is released, and don't seems that clicking on the [X] destroy/free the object.
Anyway, using "Destroy" inside OnCancel, the program crash, this is the call stack:
Code: Select all
#0 64ED3C93 wxListBase::DeleteObject() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxbase290u_gcc_custom.dll:??)
#1 6F699B9E wxDataViewCtrl::~wxDataViewCtrl() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_adv_gcc_custom.dll:??)
#2 00453E99 ~ListViewDevSelect(this=0x14aabb0) (D:/archivio/sviluppo2/angelx/projects/wxLi/include//views.hh:200)
#3 62AE8045 wxWindowBase::DestroyChildren() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#4 62A024A5 wxWindow::~wxWindow() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#5 62B11944 wxPanel::~wxPanel() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#6 62AE8045 wxWindowBase::DestroyChildren() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#7 62A024A5 wxWindow::~wxWindow() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#8 62B11944 wxPanel::~wxPanel() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#9 62AE8045 wxWindowBase::DestroyChildren() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#10 62A024A5 wxWindow::~wxWindow() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#11 62A6EF01 wxControlBase::~wxControlBase() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#12 62A388C0 wxNotebook::~wxNotebook() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#13 62AE8045 wxWindowBase::DestroyChildren() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#14 62A024A5 wxWindow::~wxWindow() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#15 62B11944 wxPanel::~wxPanel() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#16 62AE8045 wxWindowBase::DestroyChildren() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#17 62A024A5 wxWindow::~wxWindow() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#18 00457FC9 ~DlgSwConf(this=0x143df20) (D:/archivio/sviluppo2/angelx/projects/test/include//dlgswconf.hh:28)
#19 62A5C308 wxAppBase::DeletePendingObjects() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#20 62A5C3B3 wxAppBase::ProcessIdle() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#21 64EA05AE wxEventLoopManual::Run() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxbase290u_gcc_custom.dll:??)
#22 64E815B5 wxAppConsoleBase::MainLoop() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxbase290u_gcc_custom.dll:??)
#23 64EC750E wxEntryReal() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxbase290u_gcc_custom.dll:??)
#24 629C7841 wxEntry() (C:\wxWidgets-2.9.0\lib\gcc_dll\wxmsw290u_core_gcc_custom.dll:??)
#25 0042A8C8 WinMain@16(hInstance=0x400000, hPrevInstance=0x0, nCmdShow=10) (D:\archivio\sviluppo2\angelx\projects\test\src\main.cc:53)
#26 00446B54 main() (??:??)
many thanks