From 83b96fba5c49caeec2ec16d9cde27509d9430b47 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Thu, 25 Jun 2020 17:43:05 -0400 Subject: [PATCH] Set transfer flag on wxPGWindowList constructor and SetSecondary method Fixes #1696. wxPropertyGrid expects to delete both the primary and secondary controls, so we need to prevent Python from doing so. --- etg/propgrideditors.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/etg/propgrideditors.py b/etg/propgrideditors.py index f4a0ea5d..910f8407 100644 --- a/etg/propgrideditors.py +++ b/etg/propgrideditors.py @@ -89,6 +89,13 @@ def run(): if hasattr(item, 'type') and 'wxVariant' in item.type: item.type = item.type.replace('wxVariant', 'wxPGVariant') + # wxPGWindowList doesn't expect to own these, but wxPropertyGrid does, + # so flag them as transferred to the C++ side. + c = module.find('wxPGWindowList') + c.find('wxPGWindowList.primary').transfer = True + c.find('wxPGWindowList.secondary').transfer = True + c.find('SetSecondary.secondary').transfer = True + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)