mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Fixed a nasty bug where FindControl could return a reference to a
destroyed python object.
This commit is contained in:
parent
da6a971994
commit
c574b43d35
4 changed files with 7 additions and 4 deletions
|
@ -68,7 +68,9 @@ class MyObjectDefinition(GlobalObjectDefinition):
|
|||
def outputInitStructMembers(self):
|
||||
GlobalObjectDefinition.outputInitStructMembers(self)
|
||||
Output("SetCRefCon(itself, (long)it);")
|
||||
|
||||
def outputCleanupStructMembers(self):
|
||||
Output("SetCRefCon(self->ob_itself, (long)0); /* Make it forget about us */")
|
||||
|
||||
# Create the generator groups and link them
|
||||
module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff)
|
||||
object = MyObjectDefinition(OBJECTNAME, OBJECTPREFIX, OBJECTTYPE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue