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.
This commit is contained in:
Scott Talbert
2020-06-25 17:43:05 -04:00
parent b452a353ed
commit 83b96fba5c

View File

@@ -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)