[PyObjC-svn] r2335 - trunk/pyobjc/pyobjc-core/Modules/objc
[email protected] Tue, 13 Oct 2009 03:03:29 -0500
| Newsgroups | gmane.comp.python.pyobjc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: ronaldoussoren
Date: Tue Oct 13 03:03:29 2009
New Revision: 2335
Log:
Fix PyMem_ vs. PyObject_ allocator mismatch in unicode-object.m
Modified:
trunk/pyobjc/pyobjc-core/Modules/objc/unicode-object.m
Modified: trunk/pyobjc/pyobjc-core/Modules/objc/unicode-object.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/unicode-object.m (original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/unicode-object.m Tue Oct 13 03:03:29 2009
@@ -237,7 +237,7 @@
return NULL;
}
result = PyObject_New(PyObjCUnicodeObject, &PyObjCUnicode_Type);
- Py_UNICODE* tptr = PyMem_NEW(Py_UNICODE, length);
+ Py_UNICODE* tptr = PyObject_MALLOC(sizeof(Py_UNICODE) * (length+1));
PyUnicode_AS_UNICODE(result) = tptr;
tptr = NULL;
@@ -275,7 +275,7 @@
PyObjC_ENDHANDLER
result = PyObject_New(PyObjCUnicodeObject, &PyObjCUnicode_Type);
- PyUnicode_AS_UNICODE(result) = PyMem_NEW(Py_UNICODE, length);
+ PyUnicode_AS_UNICODE(result) = PyObject_MALLOC(sizeof(Py_UNICODE) * (length+1));
if (PyUnicode_AS_UNICODE(result) == NULL) {
Py_DECREF((PyObject*)result);
PyMem_Free(characters); characters = NULL;
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference