Fixed very nasty null-dereferencing bug in DisposeControl/destroy
object.
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.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)