From 802b2c43896b876eb3a63dc83be04c831e4c3050 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 25 Oct 2017 16:48:14 -0700 Subject: [PATCH 1/2] Transfer ownership of SetDropdownMenu.menu --- etg/toolbar.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etg/toolbar.py b/etg/toolbar.py index 3337fcea..f3c872b7 100644 --- a/etg/toolbar.py +++ b/etg/toolbar.py @@ -65,6 +65,7 @@ def run(): gcd.type = 'wxPyUserData*' gcd.setCppCode('return dynamic_cast(self->GetClientData());') + c.find('SetDropdownMenu.menu').transfer = True #--------------------------------------------- @@ -96,6 +97,8 @@ def run(): c.find('OnRightClick').ignore() c.find('OnLeftClick').ignore() + c.find('SetDropdownMenu.menu').transfer = True + # Add some deprecated methods to aid with Classic compatibility. # TODO: Which others are commonly enough used that they should be here too? From 69f46552dca27c417ecf53eb7d38ca9dead3a969 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 25 Oct 2017 16:50:41 -0700 Subject: [PATCH 2/2] changelog --- CHANGES.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 3d243224..b7676e78 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -38,6 +38,9 @@ Changes in this release include the following: * Add missing ``wx.GetLocale`` function. (#572) +* Fix object ownership issue for menus added to toolbar items. (#580) + +