[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] wx segfault iterating on GetChildren()
From: |
Greg Chicares |
Subject: |
[lmi] wx segfault iterating on GetChildren() |
Date: |
Sat, 11 Mar 2006 13:07:27 +0000 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Windows/20050317) |
Vadim--have you any idea why this segfaults?
I have code like this for a wxNotebook:
wxNotebookPage* page = notebook.GetPage(notebook.GetSelection());
if(!page)
throw ...
wxWindowList wl = page->GetChildren();
if(wl.IsEmpty)
throw ...
for(wxWindowList::const_iterator i = wl.begin(); i != wl.end(); ++i)
inside an EVT_CHILD_FOCUS handler, and it's segfaulting on
construction of the const_iterator. I thought one could
always construct a std::iterator even from an empty list.
This occurs only in an unusual situation: I'm testing an
EVT_NOTEBOOK_PAGE_CHANGING handler that always vetoes
every page change--even the first page "change" triggered
by creation of the notebook. That may seem a strange thing
to test, but I'm trying to test strange things in order to
make sure they get handled appropriately. Probably I'll
have to add special logic to prevent vetoing a page change
if IsShown() returns false.
Still, this seems very strange:
Program received signal SIGSEGV, Segmentation fault.
XmlNotebook::EnsureOptimalFocus (this=0x22edc4)
at /MinGW-20050120//bin/../lib/gcc/mingw32/3.4.2/../../../../\
include/c++/3.4.2/bits/stl_list.h:201
201 : _M_node(__x) { }
Current language: auto; currently c++
(gdb) bt
#0 XmlNotebook::EnsureOptimalFocus (this=0x22edc4)
at /MinGW-20050120//bin/../lib/gcc/mingw32/3.4.2/../../../../\
include/c++/3.4.2/bits/stl_list.h:201
C:/MinGW-20050120/include/c++/3.4.2/bits[0]$less -N stl_list.h
199
200 _List_const_iterator(const _List_node_base* __x)
201 : _M_node(__x) { }
202
- [lmi] wx segfault iterating on GetChildren(),
Greg Chicares <=
- Re: [lmi] wx segfault iterating on GetChildren(), Vadim Zeitlin, 2006/03/11
- Message not available
- Message not available
- Message not available
- Message not available
- Re: [lmi] wx segfault iterating on GetChildren(), Greg Chicares, 2006/03/12
- Re: [lmi] wx segfault iterating on GetChildren(), Greg Chicares, 2006/03/12
- Re: [lmi] wx segfault iterating on GetChildren(), Evgeniy Tarassov, 2006/03/16
- Re: [lmi] wx segfault iterating on GetChildren(), Greg Chicares, 2006/03/16
- Old libstdc++ problem with 'alert.cpp' [Was: [lmi] wx segfault iterating on GetChildren()], Greg Chicares, 2006/03/17
- [lmi] Failure linking sample programs: wx-2.6.2 with MinGW gcc-3.2.3 [Was: wx segfault iterating on GetChildren()], Greg Chicares, 2006/03/20
- Re: [lmi] Failure linking sample programs: wx-2.6.2 with MinGW gcc-3.2.3 [Was: wx segfault iterating on GetChildren()], Evgeniy Tarassov, 2006/03/22
- Re[2]: [lmi] Failure linking sample programs: wx-2.6.2 with MinGW gcc-3.2.3 [Was: wx segfault iterating on GetChildren()], Vadim Zeitlin, 2006/03/22
- Re: [lmi] Failure linking sample programs: wx-2.6.2 with MinGW gcc-3.2.3 [Was: wx segfault iterating on GetChildren()], Greg Chicares, 2006/03/22