Re: wxNotebook and DeleteAllPages()

Robin Dunn <[email protected]>
Newsgroups gmane.comp.python.wxpython.devel
Message-ID <[email protected]>
PyMapper Developer wrote:
> Sample attached.  This sample crashes when I call DeleteAllPages() on
> the button click.
> Here is the code for reference:
>
>     self.testNotebook = wx.Notebook(self)
>     nbPanel = wx.Window(self.testNotebook)
>     self.testNotebook.AddPage(nbPanel, "test1")
>     self.testNotebook.AddPage(nbPanel, "test2")
>     self.testNotebook.AddPage(nbPanel, "test3")

This is the problem. You are adding the same page window as 3 different
notebook pages. When you do DeleteAllPages then it is trying to destroy
the window 3 times, which will cause invalid and possibly garbage memory
to be accessed the 2nd and 3rd times.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org

-- 
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.