diff options
author | Georg Brandl <georg@python.org> | 2006-05-28 21:57:35 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-05-28 21:57:35 (GMT) |
commit | 5f6861df9300f455d600b6cd237faf429d9a06b0 (patch) | |
tree | 1d4623b3dcd8c38658883f1318d84d6aa66f401b /Mac/Modules/dlg | |
parent | c26025c562c85cac07470b832215f5f1e474aa56 (diff) | |
download | cpython-5f6861df9300f455d600b6cd237faf429d9a06b0.zip cpython-5f6861df9300f455d600b6cd237faf429d9a06b0.tar.gz cpython-5f6861df9300f455d600b6cd237faf429d9a06b0.tar.bz2 |
Correct None refcount issue in Mac modules. (Are they
still used?)
Diffstat (limited to 'Mac/Modules/dlg')
-rw-r--r-- | Mac/Modules/dlg/_Dlgmodule.c | 2 | ||||
-rw-r--r-- | Mac/Modules/dlg/dlgsupport.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Mac/Modules/dlg/_Dlgmodule.c b/Mac/Modules/dlg/_Dlgmodule.c index 64ddac8..46009a8 100644 --- a/Mac/Modules/dlg/_Dlgmodule.c +++ b/Mac/Modules/dlg/_Dlgmodule.c @@ -139,7 +139,7 @@ typedef struct DialogObject { PyObject *DlgObj_New(DialogPtr itself) { DialogObject *it; - if (itself == NULL) return Py_None; + if (itself == NULL) { Py_INCREF(Py_None); return Py_None; } it = PyObject_NEW(DialogObject, &Dialog_Type); if (it == NULL) return NULL; it->ob_itself = itself; diff --git a/Mac/Modules/dlg/dlgsupport.py b/Mac/Modules/dlg/dlgsupport.py index 1c0cc6a..fa1442e 100644 --- a/Mac/Modules/dlg/dlgsupport.py +++ b/Mac/Modules/dlg/dlgsupport.py @@ -202,7 +202,7 @@ class MyObjectDefinition(PEP253Mixin, GlobalObjectDefinition): Output("SetWRefCon(GetDialogWindow(itself), (long)it);") def outputCheckNewArg(self): - Output("if (itself == NULL) return Py_None;") + Output("if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }") def outputCheckConvertArg(self): Output("if (v == Py_None) { *p_itself = NULL; return 1; }") |