Commits

Ronald Oussoren committed d52aa85

- A bugfix that's supposed to be in 2.0.1 actually isn't :-(
- Workaround for a refcounting problem.

Comments (0)

Files changed (5)

pyobjc-core/Lib/objc/test/__init__.py

         finally:
             gc.collect()
             del p
+            gc.collect()
             
             if _useleaks:
                 leaksAfter = leaks()
                         for ln in leaksAfter:
                             print ln
 
-
-
 main = unittest.main

pyobjc-core/Modules/objc/corefoundation.m

 		/* This type is the same as an already registered type,
 		 * return that type
 		 */
+		Py_DECREF(cf);
 		Py_INCREF(result);
 		return result;
 	}
 
 	/* 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;
 }

pyobjc-core/Modules/objc/objc-class.m

 
 	if (isCFProxyClass) {
 		objc_class = nil;
+
 	} else {
 		/* First generate the objective-C class. This may change the
 		 * class dict.

pyobjc-core/Modules/objc/parsexml.m

 	int retval = -1;
 	PyObject* v;
 
-
 	if (name == NULL || type == NULL || *type == '\0') {
 		retval = 0;
 		goto end;
 	if (tollfree != NULL) {
 		Class cls = objc_lookUpClass(tollfree);
 		if (cls == NULL) {
-			//PyErr_SetString(PyObjCExc_NoSuchClassError,
-			//	tollfree);
 			retval = 0;
 			goto end;
 		}
 			Class cls = objc_lookUpClass("NSCFType");
 			if (cls == NULL) {
 				PyErr_SetString(PyObjCExc_NoSuchClassError,
-					tollfree);
+					"NSCFType");
 				goto end;
 			}
 			if (PyObjCPointerWrapper_RegisterID(type) == -1) {
 		}
 	}
 
+	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);

pyobjc-core/NEWS.txt

   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 (...)
 -------------------
 
 - 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