Author: ronaldoussoren
Date: Mon Jan 21 08:35:07 2008
New Revision: 1986
Log:
- A bugfix that's supposed to be in 2.0.1 actually isn't :-(
- Workaround for a refcounting problem.
Modified:
trunk/pyobjc/pyobjc-core/Lib/objc/test/__init__.py
trunk/pyobjc/pyobjc-core/Modules/objc/corefoundation.m
trunk/pyobjc/pyobjc-core/Modules/objc/objc-class.m
trunk/pyobjc/pyobjc-core/Modules/objc/parsexml.m
trunk/pyobjc/pyobjc-core/NEWS.txt
Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/__init__.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/__init__.py (original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/__init__.py Mon Jan 21 08:35:07 2008
@@ -37,6 +37,7 @@
finally:
gc.collect()
del p
+ gc.collect()
if _useleaks:
leaksAfter = leaks()
@@ -48,6 +49,4 @@
for ln in leaksAfter:
print ln
-
-
main = unittest.main
Modified: trunk/pyobjc/pyobjc-core/Modules/objc/corefoundation.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/corefoundation.m (original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/corefoundation.m Mon Jan 21 08:35:07 2008
@@ -113,6 +113,7 @@
/* This type is the same as an already registered type,
* return that type
*/
+ Py_DECREF(cf);
Py_INCREF(result);
return result;
}
@@ -188,10 +189,10 @@
/* Force an artificially high refcount to avoid deallocation of the
* class.
- * XXX: This is necessary to avoid problems when there are import
- * error, but that needs further investigation.
+ * XXX: This code is wrong, it hides the real problem, but I (ronald)
+ * have no idea where that problem hides itself.
*/
- Py_INCREF(result);
+ Py_INCREF(result->ob_type);
return result;
}
Modified: trunk/pyobjc/pyobjc-core/Modules/objc/objc-class.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/objc-class.m (original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/objc-class.m Mon Jan 21 08:35:07 2008
@@ -417,6 +417,7 @@
if (isCFProxyClass) {
objc_class = nil;
+
} else {
/* First generate the objective-C class. This may change the
* class dict.
Modified: trunk/pyobjc/pyobjc-core/Modules/objc/parsexml.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/parsexml.m (original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/parsexml.m Mon Jan 21 08:35:07 2008
@@ -657,7 +657,6 @@
int retval = -1;
PyObject* v;
-
if (name == NULL || type == NULL || *type == '\0') {
retval = 0;
goto end;
@@ -666,8 +665,6 @@
if (tollfree != NULL) {
Class cls = objc_lookUpClass(tollfree);
if (cls == NULL) {
- //PyErr_SetString(PyObjCExc_NoSuchClassError,
- // tollfree);
retval = 0;
goto end;
}
@@ -691,7 +688,7 @@
Class cls = objc_lookUpClass("NSCFType");
if (cls == NULL) {
PyErr_SetString(PyObjCExc_NoSuchClassError,
- tollfree);
+ "NSCFType");
goto end;
}
if (PyObjCPointerWrapper_RegisterID(type) == -1) {
@@ -727,13 +724,13 @@
}
}
+ retval = 0;
+
if (v != NULL) {
retval = PyDict_SetItemString(globalDict, name, v);
Py_DECREF(v);
}
-
- retval = 0;
end:
if (name) xmlFree(name);
if (type) xmlFree(type);
Modified: trunk/pyobjc/pyobjc-core/NEWS.txt
==============================================================================
--- trunk/pyobjc/pyobjc-core/NEWS.txt (original)
+++ trunk/pyobjc/pyobjc-core/NEWS.txt Mon Jan 21 08:35:07 2008
@@ -30,6 +30,9 @@
code. Neither are supported by the 64-bit runtime APIs (that is, it is a
restriction in Apple's Objective-C 2.0 runtime).
+- BUGFIX: The wrappers for CoreFoundation types no longer create a new type
+ in the Objective-C runtime, that type wasn't used anywhere and was an
+ unwanted side-effect of how CoreFoundation types are wrapped.
Version 2.0.1 (...)
-------------------
@@ -41,11 +44,6 @@
- BUGFIX: It is now possible to override ``respondsToSelector:`` in Python.
-- BUGFIX: The wrappers for CoreFoundation types no longer create a new type
- in the Objective-C runtime, that type wasn't used anywhere and was an
- unwanted side-effect of how CoreFoundation types are wrapped.
-
-
- Add support for interacting with '@synchronized' blocks in Objective-C.
The function ``object_lock(object)`` is a contextmanager that acquires and
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.