Ticket URL: <
http://trac.wxwidgets.org/ticket/14670#comment:2>
#14670: GDI/Memory Leak in wx.AuiNotebook
-------------------------------------------------------------+--------------
Reporter: davidsamson | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: AGW | Version: 2.9-svn
Keywords: wx.lib.agw framemanager auinotebook memory leak | Blockedby:
Patch: 0 | Blocking:
-------------------------------------------------------------+--------------
Changes (by tbrizzi):
* status: infoneeded_new => new
Comment:
Hi,
I've attached to this ticket a demonstrator correcting GDI resources
management of AGW's AuiManager containing auto-generated AuiNotebooks.
This demonstrator displays a AuiNotebook widget and each page of this
notebook contains an AuiManager displaying several panels. By default, GDI
resources consumed by this kind of page are never released when it
contains panels merged inside a notebook.
The solution was to overload the Destroy method of the view displaying the
panels the following way :
{{{
class MyView(wx.Panel):
def __init__(self, *args, **kwargs):
super(MyView, self).__init__(*args, **kwargs)
# create the layout
self.manager = MyManager(self, agwFlags=aui.AUI_MGR_DEFAULT)
...
def Destroy(self):
# release resources occupied by AuiManager
# objects relative to each AuiNotebook
for nb in self.manager.GetNotebooks() :
nb._mgr.UnInit()
nb._mgr.Destroy()
nb.Destroy()
# release resources occupied by the AuiManager
# relative to the notebook containg this page
self.manager.UnInit()
self.manager.Destroy()
super(MyView, self).Destroy()
}}}
Please, close the ticket if it has been effectively corrected in a stable
version of AGW.
Regards.
--
Ticket URL: <
http://trac.wxwidgets.org/ticket/14670#comment:2>