Alan Wolfe
2011-06-20 17:03:35 UTC
Hi!
I'm hitting an issue where when i disconnect an event I'm getting a stack
overflow.
The details are that i have a wxScrolledWindow (inside of a sizer which is
inside of another sizer, which is inside of a panel which is.... etc).
Inside of that scrolled window I'm creating several wxCheckBoxes like so...
("this" is my main wxFrame)
wxCheckBox *pNewCheckBox = new wxCheckBox(m_scrolledWindow1,
wxID_ANY, pBone->m_sBoneName.c_str());
bSizer5->Add(pNewCheckBox, 0, wxALL, 5);
pNewCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED,
wxCommandEventHandler( wxASMainFormReal::OnBoneSetBoneClicked ),
pNewCheckBox, this );
Then, when i go to clear them out i do something like this:
wxSizerItemList &rItemList = bSizer5->GetChildren();
for(wxSizerItemList::iterator it = rItemList.begin(); it !=
rItemList.end(); ++it)
{
wxCheckBox *pCB = wxDynamicCast((*it)->GetWindow(),wxCheckBox);
if(pCB)
{
//TODO: why does this cause a stack overflow?
pCB->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED,
wxCommandEventHandler( wxASMainFormReal::OnBoneSetBoneClicked ), pCB, this
);
}
}
bSizer5->Clear(true);
The stack overflow happens in the Disconnect, but if I don't disconnect, it
happens in the Clear function at the end. The stack looks like below,
repeating all the way to the bottom where it says the max # of frames in
visual studio has been exceeded so i can't look any deeper.
bytes C++
AnimSandbox.exe!wxEvtHandler::~wxEvtHandler() + 0x73 bytes C++
AnimSandbox.exe!wxEvtHandler::`vector deleting destructor'() + 0x8
bytes C++
AnimSandbox.exe!wxEvtHandler::~wxEvtHandler() + 0x73 bytes C++
Anyone know what I might be doing wrong?
Thanks!
I'm hitting an issue where when i disconnect an event I'm getting a stack
overflow.
The details are that i have a wxScrolledWindow (inside of a sizer which is
inside of another sizer, which is inside of a panel which is.... etc).
Inside of that scrolled window I'm creating several wxCheckBoxes like so...
("this" is my main wxFrame)
wxCheckBox *pNewCheckBox = new wxCheckBox(m_scrolledWindow1,
wxID_ANY, pBone->m_sBoneName.c_str());
bSizer5->Add(pNewCheckBox, 0, wxALL, 5);
pNewCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED,
wxCommandEventHandler( wxASMainFormReal::OnBoneSetBoneClicked ),
pNewCheckBox, this );
Then, when i go to clear them out i do something like this:
wxSizerItemList &rItemList = bSizer5->GetChildren();
for(wxSizerItemList::iterator it = rItemList.begin(); it !=
rItemList.end(); ++it)
{
wxCheckBox *pCB = wxDynamicCast((*it)->GetWindow(),wxCheckBox);
if(pCB)
{
//TODO: why does this cause a stack overflow?
pCB->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED,
wxCommandEventHandler( wxASMainFormReal::OnBoneSetBoneClicked ), pCB, this
);
}
}
bSizer5->Clear(true);
The stack overflow happens in the Disconnect, but if I don't disconnect, it
happens in the Clear function at the end. The stack looks like below,
repeating all the way to the bottom where it says the max # of frames in
visual studio has been exceeded so i can't look any deeper.
AnimSandbox.exe!wxEvtHandler::~wxEvtHandler() + 0xd bytes C++
AnimSandbox.exe!wxEvtHandler::`vector deleting destructor'() + 0x8bytes C++
AnimSandbox.exe!wxEvtHandler::~wxEvtHandler() + 0x73 bytes C++
AnimSandbox.exe!wxEvtHandler::`vector deleting destructor'() + 0x8
bytes C++
AnimSandbox.exe!wxEvtHandler::~wxEvtHandler() + 0x73 bytes C++
Anyone know what I might be doing wrong?
Thanks!
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users