[PyObjC-svn] r2062 - trunk/pyobjc/pyobjc-core/Modules/objc
| Newsgroups | gmane.comp.python.pyobjc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: ronaldoussoren
Date: Sun Mar 1 06:12:18 2009
New Revision: 2062
Log:
Fix issue that caused output arguments that are arrays of an indetermined size to be handled incorrectly
(and example of such a function is ``CGColorSpaceGetColorTable``)
Modified:
trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m
trunk/pyobjc/pyobjc-core/Modules/objc/objc_util.m
Modified: trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m (original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m Sun Mar 1 06:12:18 2009
@@ -3262,7 +3262,7 @@
} else {
v = PyObjC_VarList_New(methinfo->rettype.type, pRetval);
- goto error_cleanup;
+ if (!v) goto error_cleanup;
}
break;
Modified: trunk/pyobjc/pyobjc-core/Modules/objc/objc_util.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/objc_util.m (original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/objc_util.m Sun Mar 1 06:12:18 2009
@@ -678,10 +678,14 @@
if (have_buffer != -1) {
if (size == NULL) {
*array = buf;
+ *bufobj = pythonList;
+ Py_INCREF(pythonList);
} else if (*size == -1) {
*array = buf;
*size = bufsize;
+ *bufobj = pythonList;
+ Py_INCREF(pythonList);
} else {
if ((exactSize && *size != bufsize) || (!exactSize && *size > bufsize)) {
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H