Merge pull request #1065 from RobinD42/fix-issue1061

Transfer ownership of the wx.aui.AuiNotbook.SetArtProvider art parameter

(cherry picked from commit a55e4ec45d)
This commit is contained in:
Robin Dunn
2018-10-29 22:17:11 -07:00
parent 653d91b372
commit ceb2f46720
3 changed files with 11 additions and 0 deletions

View File

@@ -167,6 +167,10 @@ Changes in this release include the following:
* Fix wx.html.HtmlPrintout to not be seen as an abstract class, so it can be
instantiated. (#1060)
* Fix wx.aui.AuiNotbook.SetArtProvider to properly transfer ownership of the art
object from Python to C++. This possible double-deletion and related crashing
problems. (#1061)

View File

@@ -43,6 +43,8 @@ def run():
assert isinstance(c, etgtools.ClassDef)
tools.fixWindowClass(c)
tools.fixBookctrlClass(c)
c.find('SetArtProvider.art').transfer = True
c = module.find('wxAuiTabContainer')
tools.ignoreConstOverloads(c)

View File

@@ -97,6 +97,11 @@ class auibook_Tests(wtc.WidgetTestCase):
wx.aui.EVT_AUINOTEBOOK_BG_DCLICK
def test_auibook11(self):
nb = wx.aui.AuiNotebook(self.frame)
nb.AddPage(wx.Panel(nb), "Page")
nb.SetArtProvider(wx.aui.AuiDefaultTabArt())
#---------------------------------------------------------------------------