summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/ctl/ctledit.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-10-01 10:46:46 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-10-01 10:46:46 (GMT)
commitcfb60ee1e88118ca50254cf073b934a136e9f96a (patch)
tree7f70825383edcad46001fdd5c63fe9265f69a57c /Mac/Modules/ctl/ctledit.py
parentcc778ebd62a5e256c6cf44b32f417658cce1751c (diff)
downloadcpython-cfb60ee1e88118ca50254cf073b934a136e9f96a.zip
cpython-cfb60ee1e88118ca50254cf073b934a136e9f96a.tar.gz
cpython-cfb60ee1e88118ca50254cf073b934a136e9f96a.tar.bz2
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
object.
Diffstat (limited to 'Mac/Modules/ctl/ctledit.py')
-rw-r--r--Mac/Modules/ctl/ctledit.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Mac/Modules/ctl/ctledit.py b/Mac/Modules/ctl/ctledit.py
index d877012..9240851 100644
--- a/Mac/Modules/ctl/ctledit.py
+++ b/Mac/Modules/ctl/ctledit.py
@@ -6,3 +6,21 @@ f = ManualGenerator("as_Resource", as_resource_body)
f.docstring = lambda : "Return this Control as a Resource"
methods.append(f)
+
+DisposeControl_body = """
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ if ( _self->ob_itself ) {
+ SetCRefCon(_self->ob_itself, (long)0); /* Make it forget about us */
+ DisposeControl(_self->ob_itself);
+ _self->ob_itself = NULL;
+ }
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+"""
+
+f = ManualGenerator("DisposeControl", DisposeControl_body)
+f.docstring = lambda : "() -> None"
+
+methods.append(f)