summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/ctl/ctlsupport.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-04-12 16:26:59 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-04-12 16:26:59 (GMT)
commitc574b43d35e08f85843bb72938850ecd1dde7d82 (patch)
tree2f43d80d0eb72736d92150b3a285ec181a008667 /Mac/Modules/ctl/ctlsupport.py
parentda6a9719940925c3a6173434d7aa55b9a69c3b4d (diff)
downloadcpython-c574b43d35e08f85843bb72938850ecd1dde7d82.zip
cpython-c574b43d35e08f85843bb72938850ecd1dde7d82.tar.gz
cpython-c574b43d35e08f85843bb72938850ecd1dde7d82.tar.bz2
Fixed a nasty bug where FindControl could return a reference to a
destroyed python object.
Diffstat (limited to 'Mac/Modules/ctl/ctlsupport.py')
-rw-r--r--Mac/Modules/ctl/ctlsupport.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Mac/Modules/ctl/ctlsupport.py b/Mac/Modules/ctl/ctlsupport.py
index c87922a..cef9f8a 100644
--- a/Mac/Modules/ctl/ctlsupport.py
+++ b/Mac/Modules/ctl/ctlsupport.py
@@ -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)