From 6865d2ea69b812eb3d0388e7b430bf52eb997299 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 29 Oct 2018 20:02:10 -0700 Subject: [PATCH] Transfer ownership of the wx.aui.AuiNotbook.SetArtProvider art parameter. --- CHANGES.rst | 4 ++++ etg/auibook.py | 2 ++ unittests/test_auibook.py | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 731b2a23..d6777920 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -138,6 +138,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) + diff --git a/etg/auibook.py b/etg/auibook.py index c29946bb..f9e8e1e3 100644 --- a/etg/auibook.py +++ b/etg/auibook.py @@ -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) diff --git a/unittests/test_auibook.py b/unittests/test_auibook.py index d2908752..5f4b1d3c 100644 --- a/unittests/test_auibook.py +++ b/unittests/test_auibook.py @@ -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()) + #---------------------------------------------------------------------------