lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] wx segfault iterating on GetChildren()


From: Vadim Zeitlin
Subject: Re: [lmi] wx segfault iterating on GetChildren()
Date: Sat, 11 Mar 2006 15:07:48 +0100

On Sat, 11 Mar 2006 13:07:27 +0000 Greg Chicares <address@hidden> wrote:

GC> I have code like this for a wxNotebook:
GC> 
GC>     wxNotebookPage* page = notebook.GetPage(notebook.GetSelection());
GC>     if(!page)
GC>         throw ...
GC>     wxWindowList wl = page->GetChildren();
GC>     if(wl.IsEmpty)
GC>         throw ...
GC>     for(wxWindowList::const_iterator i = wl.begin(); i != wl.end(); ++i)
GC> 
GC> inside an EVT_CHILD_FOCUS handler, and it's segfaulting on
GC> construction of the const_iterator. I thought one could
GC> always construct a std::iterator even from an empty list.

 As there an IsEmpty() test just above I don't see how can it be related to
the list being empty (and, of course, begin() should be always safe to
call, even on an empty container). So something else must be wrong but I
honestly have no idea what. Have you tried to reproduce this bug in e.g.
the notebook sample by chance?

 Thanks,
VZ





reply via email to

[Prev in Thread] Current Thread [Next in Thread]