diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1996-10-01 10:46:46 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1996-10-01 10:46:46 (GMT) |
commit | cfb60ee1e88118ca50254cf073b934a136e9f96a (patch) | |
tree | 7f70825383edcad46001fdd5c63fe9265f69a57c /Mac/Modules/ctl/ctledit.py | |
parent | cc778ebd62a5e256c6cf44b32f417658cce1751c (diff) | |
download | cpython-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.py | 18 |
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) |