Commits

Ronald Oussoren committed 90aa4bb

Clean up the fix for bug 1206669 and use the same mechanism in custom IMP
implementations.

Comments (0)

Files changed (20)

Lib/objc/test/test_initialized.py

     def init(self):
         return super(OC_TestInitializePython, self).init()
 
+OBJECT_LIST=[]
+class OC_TestInitializePython2 (OC_TestInitialize):
+    def init(self):
+        self = super(OC_TestInitializePython2, self).init()
+        OBJECT_LIST.append(self)
+        return self
+
 class TestInitializing (unittest.TestCase):
     #
     # These tests make sure that we don't call retain/release on objects
         v = OC_TestInitialize.numUninitialized()
         self.assertEquals(v, start)
 
+    def testDontRetainUnitialized4(self):
+        start = OC_TestInitialize.numUninitialized()
+        self.assertEquals(start, 0)
+
+        o = OC_TestInitializePython2.makeInstance()
+        self.assert_(isinstance(o, OC_TestInitializePython2))
+        self.assert_(OBJECT_LIST[-1] is o)
+        del OBJECT_LIST[-1]
+
+        v = OC_TestInitialize.numUninitialized()
+        self.assertEquals(v, start)
+
+        s = o.dummy()
+        self.assertEquals(s, u"hello")
+        v = OC_TestInitialize.numUninitialized()
+        self.assertEquals(v, start)
+
 if __name__ == "__main__":
     unittest.main()

Modules/AppKit/_AppKitMapping_NSBezierPath.m

 	PyObject* arglist = NULL;
 	PyObject* v;
 	int i;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(4);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (self == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	v = PyTuple_New(count);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	Py_DECREF(result);
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 
 	PyObject* arglist = NULL;
 	PyObject* v;
 	int i;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(3);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (self == NULL) goto error;
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	v = PyTuple_New(count);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	Py_DECREF(result);
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 
 	int err;
 	int pointCount;
 	int i;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(2);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	v = PyInt_FromLong(idx);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	seq = PySequence_Fast(result, "should return tuple of lenght 2");
 error:
 	*(NSBezierPathElement*)resp = 0;
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	Py_XDECREF(seq);
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 	PyObject* result;
 	PyObject* arglist = NULL;
 	PyObject* v;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(4);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	v = PyObjC_CArrayToPython(@encode(float), pattern, count);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	Py_DECREF(result);
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 

Modules/AppKit/_AppKitMapping_NSFont.m

 	PyObject* seq = NULL;
 	PyObject* v;
 	int i;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(3);
 	if (arglist == NULL) goto error;
 	
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	v = PyObjC_CArrayToPython(@encode(NSGlyph), glyphs, numGlyphs);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	if (!PyTuple_Check(result)) {
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	Py_XDECREF(result);
 	Py_XDECREF(seq);
 	*pretval = -1;

Modules/AppKit/_AppKitMapping_NSMovie.m

 
 	PyObject* result;
 	PyObject* arglist = NULL;
-	PyObject* v;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(1);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	MovieObj_Convert(result, pretval);
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	*pretval = NULL;
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 	PyObject* result;
 	PyObject* arglist = NULL;
 	PyObject* v;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(1);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 	
 	v = MovieObj_New(movie);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	*pretval = PyObjC_PythonToId(result);
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	*pretval = nil;
 	PyObjCErr_ToObjCWithGILState(&state);
 }

Modules/AppKit/_AppKitMapping_NSQuickDrawView.m

 
 	PyObject* result;
 	PyObject* arglist = NULL;
-	PyObject* v;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(1);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	GrafObj_Convert(result, pretval);
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	*pretval = NULL;
 	PyObjCErr_ToObjCWithGILState(&state);
 }

Modules/AppKit/_AppKitMapping_NSWindow.m

 
 	PyObject* result;
 	PyObject* arglist = NULL;
-	PyObject* v;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(1);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	WinObj_Convert(result, pretval);
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	*pretval = NULL;
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 	PyObject* result;
 	PyObject* arglist = NULL;
 	PyObject* v;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(2);
 	if (arglist == NULL) goto error;
 	
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 	
 	v = WinObj_New(windowRef);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	*pretval = PyObjC_PythonToId(result);
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	*pretval = nil;
 	PyObjCErr_ToObjCWithGILState(&state);
 }

Modules/Foundation/_Foundation.m

 	PyObject* arglist = NULL;
 	PyObject* v = NULL;
 	PyGILState_STATE state;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	*preturnValue = nil;
 
 	arglist = PyTuple_New(3);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SET_ITEM(arglist, 0, pyself);
+	Py_INCREF(pyself);
 
 	v = PyObjC_CArrayToPython(@encode(id), objects, count);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL); 
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	*preturnValue = PyObjC_PythonToId(result);
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie);
+	}
+
 	PyObjCErr_ToObjCWithGILState(&state);
 	*preturnValue = nil;
 }

Modules/Foundation/_FoundationMapping_NSCoder.m

 	PyObject* result = NULL;
 	PyObject* arglist = NULL;
 	PyObject* v = NULL;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(3);
 	if (arglist == NULL) goto error;
 	
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SetItem(arglist, 0,  v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0,  pyself);
+	Py_INCREF(pyself);
 
 	v = PyString_FromString(signature);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
+
 	if (result == NULL) goto error;
 
 	if (result != Py_None) {
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 
 	PyObject* values = NULL;
 	int       size;
 	int       i;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	size = PyObjCRT_SizeOfType(signature);
 	if (size == -1) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SET_ITEM(arglist, 0, pyself);
+	Py_INCREF(pyself);
 
 	v = PyString_FromString(signature);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
+
 	if (result == NULL) goto error;
 
 	if (result != Py_None) {
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie);
+	}
 	Py_XDECREF(values);
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 	PyObject* arglist = NULL;
 	PyObject* v;
 	int err;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(2);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SetItem(arglist, 0, v); 
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	v = PyString_FromString(signature);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	err = PyObjC_PythonToObjC(signature, result, buf);
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 	return;
 }
 	int       size;
 	int       i;
 	int res;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	size = PyObjCRT_SizeOfType(signature);
 	if (size == -1) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SetItem(arglist, 0, v); 
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	v = PyString_FromString(signature);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) {
 		PyObjCErr_ToObjCWithGILState(&state);
 		return;
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	Py_XDECREF(seq);
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 	PyObject* result;
 	PyObject* arglist = NULL;
 	PyObject* v;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(3);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SetItem(arglist, 0, v); 
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	v = PyString_FromStringAndSize(bytes, length);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	if (result != Py_None) {
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 
 	const void** pretval = (const void**)resp;
 
 	PyObject* result;
-	PyObject* v;
 	PyObject* arglist = NULL;
 	int buflen;
 	int len;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(1);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SetItem(arglist, 0, v); 
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	if (!PyTuple_Check(result)) {
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 	*pretval = NULL;
 }
 	PyObject* v;
 	int buflen;
 	int len;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	if (!PyTuple_Check(result)) {
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 	*pretval = NULL;
 }
 	PyObject* result;
 	PyObject* arglist = NULL;
 	PyObject* v;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(4);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SetItem(arglist, 0, v); 
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	v = PyString_FromStringAndSize(bytes, length);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	if (result != Py_None) {
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 

Modules/Foundation/_FoundationMapping_NSData.m

 	char* data = *(char**)args[2];
 	unsigned len = *(unsigned*)args[3];
 	id* pretval = (id*)resp;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyObject* result;
 	PyObject* v;
 	arglist = PyTuple_New(3);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SetItem(arglist, 0, v); 
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	v = PyString_FromStringAndSize(data, len);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	*pretval = PyObjC_PythonToId(result);
 error:
 	*pretval = nil;
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 
 
 	PyObject* result;
 	PyObject* arglist = NULL;
-	PyObject* v;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(1);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	if (result == Py_None) {
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 	*pretval = NULL;
 }
 	void** pretval = (void**)resp;
 	PyObject* result;
 	PyObject* arglist = NULL;
-	PyObject* v;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(1);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	if (result == Py_None) {
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	*pretval = NULL;
 	PyObjCErr_ToObjCWithGILState(&state);
 }

Modules/Foundation/_FoundationMapping_NSDecimalNumber.m

 	PyObject* result = NULL;
 	PyObject* arglist = NULL;
 	PyObject* v = NULL;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(2);
 	if (arglist == NULL) goto error;
 	
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SetItem(arglist, 0,  v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	v = Decimal_New(&aDecimal);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	*pretval = PyObjC_PythonToId(result);
 error:
 	*pretval = nil;
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 
 	PyObject* result = NULL;
 	PyObject* arglist = NULL;
 	PyObject* v = NULL;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	Decimal_Convert(result, &res);
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 #endif /* MACOSX */

Modules/Foundation/_FoundationMapping_NSDictionary.m

 	PyObject* arglist = NULL;
 	PyObject* v;
 	int i;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(4);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	v = PyTuple_New(count);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	*pretval = PyObjC_PythonToId(result);
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	*pretval = nil;
 	PyObjCErr_ToObjCWithGILState(&state);
 }

Modules/Foundation/_FoundationMapping_NSMutableArray.m

 	PyObject* arglist = NULL;
 	PyObject* v;
 	int i;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(3);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	v = PyTuple_New(count);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	Py_DECREF(result);
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 
 	PyObject* arglist = NULL;
 	PyObject* v;
 	int i;
+	PyObject* pyself = NULL;
+	int cookie = 0;
 
 	PyGILState_STATE state = PyGILState_Ensure();
 
 	arglist = PyTuple_New(4);
 	if (arglist == NULL) goto error;
 
-	v = PyObjC_IdToPython(self);
-	if (v == NULL) goto error;
-	PyTuple_SET_ITEM(arglist, 0, v);
+	pyself = PyObjCObject_NewTransient(self, &cookie);
+	if (pyself == NULL) goto error;
+	PyTuple_SetItem(arglist, 0, pyself); 
+	Py_INCREF(pyself);
 
 	v = PyObjC_ObjCToPython(@encode(NSRange), &range);
 	if (v == NULL) goto error;
 
 	result = PyObject_Call((PyObject*)callable, arglist, NULL);
 	Py_DECREF(arglist); arglist = NULL;
+	PyObjCObject_ReleaseTransient(pyself, cookie); pyself = NULL;
 	if (result == NULL) goto error;
 
 	Py_DECREF(result);
 
 error:
 	Py_XDECREF(arglist);
+	if (pyself) {
+		PyObjCObject_ReleaseTransient(pyself, cookie); 
+	}
 	PyObjCErr_ToObjCWithGILState(&state);
 }
 

Modules/objc/libffi_support.m

 	PyObject*          v;
 	int                have_output = 0;
 	const char*        rettype;
-	PyObject* pyself;
-#define UNINIT
-#ifdef UNINIT
-	int		didCreate = 0;
-#endif
+	PyObject* 	   pyself;
+	int		   cookie;
 
 	PyGILState_STATE   state = PyGILState_Ensure();
 
 
 	arglist = PyList_New(0);
 
-#ifndef UNINIT
-	pyself = pythonify_c_value(@encode(id), args[0+argOffset]);
-#else
-	/* just calling pythonify_c_value is not not correct: we should
-	 * try to avoid calling -retain because this can cause problems is
-	 * self is freshly +alloc-ed and this is a call to the initializer
-	 *
-	 * It is 99+% sure that self won't be treated specially by 
-	 * pythonify_c_value, it is extremely unlikely that anyone want's to
-	 * subclass a class that is treated specially by that function.
-	 */
-	pyself = PyObjC_FindPythonProxy(*(id*)args[0+argOffset]);
-	if (pyself == NULL) {
-		/* This is a bit of a hack, should drop NewXXX() and add
-		 * some arguments to New()
-		 */
-		pyself = PyObjCObject_NewUnitialized(*(id*)args[0+argOffset]);
-
-		((PyObjCObject*)pyself)->flags |= PyObjCObject_kSHOULD_NOT_RELEASE;
-		((PyObjCObject*)pyself)->flags &= ~PyObjCObject_kUNINITIALIZED;
-		didCreate = 1;
-	}
-
-#endif
+	pyself = PyObjCObject_NewTransient(*(id*)args[0+argOffset], &cookie);
 	if (pyself == NULL) {
 		goto error;
 	}
 	if (PyList_Append(arglist, pyself) == -1) {
 		goto error;
 	}
-	Py_DECREF(pyself);
 
 	/* First translate from Objective-C to python */
 	
 	v = PyList_AsTuple(arglist);
 	if (v == NULL) {
 		Py_DECREF(arglist);
+		PyObjCObject_ReleaseTransient(pyself, cookie);
 		goto error;
 	}
 	Py_DECREF(arglist);
 
 	res = PyObject_Call(callable, arglist, NULL);
 	isAlloc = PyObjCSelector_DonatesRef(callable);
-
-#ifdef UNINIT
-	if (pyself->ob_refcnt != 1 && didCreate) {
-		/* Oops, additional references to the proxy, make sure we
-		 * own a reference to the ObjC object
-		 */
-		[PyObjCObject_GetObject(pyself) retain];
-		((PyObjCObject*)pyself)->flags &= ~PyObjCObject_kUNINITIALIZED;
-	}
-#endif
 	Py_DECREF(arglist);
+	PyObjCObject_ReleaseTransient(pyself, cookie);
 	if (res == NULL) {
 		goto error;
 	}

Modules/objc/objc-object.h

 #define PyObjCObject_GetFlags(object) (((PyObjCObject*)(object))->flags)
 #define PyObjCObject_IsClassic(object) (PyObjCObject_GetFlags(object) & PyObjCObject_kCLASSIC)
 
+PyObject* PyObjCObject_NewTransient(id objc_object, int* cookie);
+void PyObjCObject_ReleaseTransient(PyObject* proxy, int cookie);
+
 #endif /* PyObjC_OBJC_OBJECT_H */

Modules/objc/objc-object.m

 			((PyObjCObject*)object)->objc_object, object);
 	((PyObjCObject*)object)->objc_object = nil;
 }
+
+PyObject* PyObjCObject_NewTransient(id objc_object, int* cookie)
+{
+	PyObject* result;
+
+	result = PyObjC_FindPythonProxy(objc_object);
+	if (result) {
+		*cookie = 0;
+		return result;
+	}
+
+	*cookie = 1;
+	result = PyObjCObject_NewUnitialized(objc_object);
+	((PyObjCObject*)result)-> flags |= PyObjCObject_kSHOULD_NOT_RELEASE;
+	((PyObjCObject*)result)-> flags &= ~PyObjCObject_kUNINITIALIZED;
+	return result;
+}
+
+void PyObjCObject_ReleaseTransient(PyObject* proxy, int cookie)
+{
+	if (cookie && proxy->ob_refcnt != 1) {
+		[PyObjCObject_GetObject(proxy) retain];
+		((PyObjCObject*)proxy)-> flags &= ~PyObjCObject_kSHOULD_NOT_RELEASE;
+	} 
+	Py_DECREF(proxy);
+}
+

Modules/objc/pyobjc-api.h

      PyObjCClass_Convert, PyObjC_ConvertBOOL, and PyObjC_ConvertChar
  * - Version 12 adds PyObjCObject_New
  * - Version 13 adds PyObjCCreateOpaquePointerType
+ * - Version 14 adds PyObjCObject_NewTransient, PyObjCObject_ReleaseTransient
  */
-#define PYOBJC_API_VERSION 13
+#define PYOBJC_API_VERSION 14
 
 #define PYOBJC_API_NAME "__C_API__"
 
 
 	/* PyObjCCreateOpaquePointerType */
 	PyObject* (*pointer_type_new)(const char*, const char*, const char*);
+
+	/* PyObject* PyObjCObject_NewTransient(id objc_object, int* cookie); */
+	PyObject* (*newtransient)(id objc_object, int* cookie);
+
+	/* void PyObjCObject_ReleaseTransient(PyObject* proxy, int cookie); */
+	void (*releasetransient)(PyObject* proxy, int cookie);
+	
 	
 };
 
 #define PyObjC_ConvertChar (PyObjC_API->pyobjc_convertchar)
 #define PyObjCObject_New (PyObjC_API->pyobjc_object_new)
 #define PyObjCCreateOpaquePointerType (PyObjC_API->pointer_type_new)
-
+#define PyObjCObject_NewTransient (PyObjC_API->newtransient)
+#define PyObjCObject_ReleaseTransient (PyObjC_API->releasetransient)
 
 #ifndef PYOBJC_METHOD_STUB_IMPL
 

Modules/objc/pyobjc-api.m

 	PyObjC_ConvertChar,     /* pyobjc_convertchar */
 	PyObjCObject_New,		/* pyobjc_object_new */
 	PyObjCCreateOpaquePointerType, /* pointer_type_new */
+	PyObjCObject_NewTransient,	/* newtransient */
+	PyObjCObject_ReleaseTransient,  /* releasetransient */
 };
 
 int PyObjCAPI_Register(PyObject* module)

Modules/objc/test/instanceVariables.m

 	Py_XDECREF(pyValue);
 	[objValue release];
 	[nilValue release];
+	[super dealloc];
 }
 
 @end
 <body>
 <h2>PyObjC NEWS</h2>
 <p>An overview of the relevant changes in new, and older, releases.</p>
-<h2><a name="version-1-3-6-2005-05-19">Version 1.3.6 (2005-05-19)</a></h2>
+<h2><a>Version 1.3.7 (????-??-??)</a></h2>
+<ul>
+<li>Fixed a problem with reference counting in initializers.</li>
+</ul>
+<h2><a>Version 1.3.6 (2005-05-19)</a></h2>
 <ul>
 <li>Fixed bugs in the ProgressViewPalette example</li>
 <li>Fixed a bug in the class builder that caused most plugins to break</li>
 <li>Removed all references to Project Builder</li>
 <li>Mac OS X 10.2 (Jaguar) no longer supported</li>
 </ul>
-<h2><a name="version-1-3-5-2005-05-18">Version 1.3.5 (2005-05-18)</a></h2>
+<h2><a>Version 1.3.5 (2005-05-18)</a></h2>
 <ul>
 <li>Importing objc now ensures that Foundation is multi-threaded, previously
 it only ensured that Python was.</li>
 <code><span>array.array</span></code> (but not <code><span>str</span></code> or <code><span>unicode</span></code>) are now bridged as
 <code><span>NSData</span></code> subclasses.</li>
 </ul>
-<h2><a name="version-1-3-2005-03-31">Version 1.3 (2005-03-31)</a></h2>
+<h2><a>Version 1.3 (2005-03-31)</a></h2>
 <ul>
 <li>New <code><span>objc.pyobjc_id</span></code> function that returns a the id of the underlying
 NSObject as an integer.  (Python wrapper objects are often made on the
 function is also exposed in the C API (and has been for a while).</p>
 </li>
 </ul>
-<h2><a name="version-1-2-2004-12-29">Version 1.2 (2004-12-29)</a></h2>
+<h2><a>Version 1.2 (2004-12-29)</a></h2>
 <ul>
 <li><code><span>PyObjCTools.AppHelper.stopEventLoop</span></code> will attempt to stop the current
 <code><span>NSRunLoop</span></code> (if started by <code><span>runConsoleEventLoop</span></code>) or terminate the
 packages as <code><span>objc._objc</span></code>, <code><span>AppKit._AppKit</span></code>, etc.  They should never be
 used directly, so this should not break user code.</li>
 </ul>
-<h2><a name="version-1-1-2004-05-30">Version 1.1 (2004-05-30)</a></h2>
+<h2><a>Version 1.1 (2004-05-30)</a></h2>
 <ul>
 <li>KVO now actually works from Python without using nasty hacks.</li>
 <li>Added Xcode template for document-based applications</li>
 </ul>
-<h2><a name="version-1-1b2-2004-04-11">Version 1.1b2 (2004-04-11)</a></h2>
+<h2><a>Version 1.1b2 (2004-04-11)</a></h2>
 <ul>
 <li>More fine-grained multi-threading support</li>
 <li>Xcode templates use a smarter embedded main program</li>
 expression in Objective-C.</li>
 <li>Add several new examples</li>
 </ul>
-<h2><a name="version-1-1b1-2004-02-20">Version 1.1b1 (2004-02-20)</a></h2>
+<h2><a>Version 1.1b1 (2004-02-20)</a></h2>
 <ul>
 <li>Fixes some regressions in 1.1 w.r.t. 1.0</li>
 <li>Add Xcode templates for python files<p>You can now select a new python file in the 'add file...' dialog in Xcode</p>
 accessor method.</p>
 </li>
 </ul>
-<h2><a name="version-1-1a0-2004-02-02">Version 1.1a0 (2004-02-02)</a></h2>
+<h2><a>Version 1.1a0 (2004-02-02)</a></h2>
 <ul>
 <li>Objective-C structs can now be wrapped using struct-like types. This has
 been used to implement wrapper types for NSPoint, NSSize, NSRange and NSRect
 </ul>
 </li>
 </ul>
-<h2><a name="version-1-0-2003-09-21">Version 1.0 (2003-09-21)</a></h2>
+<h2><a>Version 1.0 (2003-09-21)</a></h2>
 <ul>
 <li>This version includes a new version of libffi that properly deals with
 complex types on MacOS X.</li>
 </ul>
-<h2><a name="version-1-0rc3-2003-09-14">Version 1.0rc3 (2003-09-14)</a></h2>
+<h2><a>Version 1.0rc3 (2003-09-14)</a></h2>
 <ul>
 <li>1.0rc2 didn't include the nibclassbuilder script</li>
 <li>Fix bug in NSRectFillList</li>
 </ul>
-<h2><a name="version-1-0rc2-2003-09-10">Version 1.0rc2 (2003-09-10)</a></h2>
+<h2><a>Version 1.0rc2 (2003-09-10)</a></h2>
 <ul>
 <li>Fix a number of bugs found in 1.0rc1.</li>
 </ul>
-<h2><a name="version-1-0rc1-2003-08-10">Version 1.0rc1 (2003-08-10)</a></h2>
+<h2><a>Version 1.0rc1 (2003-08-10)</a></h2>
 <ul>
 <li>Better support for the NSKeyValueCoding protocol.  The module 
 <code><span>PyObjCTools.KeyValueCoding</span></code> provides a python interface that makes it
 <li>The interface of Foundation.NSFillRects changed, it now has an interface
 that is consistent with the rest of the bridge.</li>
 </ul>
-<h2><a name="version-1-0b1-2003-07-05">Version 1.0b1 (2003-07-05)</a></h2>
+<h2><a>Version 1.0b1 (2003-07-05)</a></h2>
 <ul>
 <li>More tutorials<p>Two new tutorials were added: 'Adding Python code to an existing ObjC 
 application' and 'Understanding existing PyObjC examples'. The former
 <li>The generator scripts are automaticly called when building PyObjC. This
 should make it easier to support multiple versions of MacOS X.</li>
 </ul>
-<h2><a name="version-0-9-may-02-2003">Version 0.9 (May-02-2003)</a></h2>
+<h2><a>Version 0.9 (May-02-2003)</a></h2>
 <ul>
 <li>This version includes numerous bugfixes and improvements.</li>
 <li>The module AppKit.NibClassBuilder has been moved to the package
 makes it easily possible to use NSString values with Python APIs, while at 
 the same time allowing access to the full power of NSString.</li>
 </ul>
-<h2><a name="version-0-8-dec-10-2002">Version 0.8 (Dec-10-2002)</a></h2>
+<h2><a>Version 0.8 (Dec-10-2002)</a></h2>
 <ul>
 <li>GNUStep support has been removed for lack of support.  Volunteers
 needed.</li>
 <li>Support for Project Builder based Cocoa-Python projects.</li>
 <li>Unit tests.</li>
 </ul>
-<h2><a name="version-2002-01-30-january-30-2002">Version 2002-01-30 (January 30, 2002)</a></h2>
+<h2><a>Version 2002-01-30 (January 30, 2002)</a></h2>
 <ul>
 <li>Version bumped to 0.6.1 ( __version__ is now a PyString )</li>
 <li>Will now build for Python 2.2</li>
 without check, it crashes on sends to abstract classes like NSProxy.</li>
 <li>There are still problems with Delegates and Notifications.</li>
 </ul>
-<h2><a name="version-2001-03-17-march-17-2001">Version 2001-03-17 (March 17, 2001)</a></h2>
+<h2><a>Version 2001-03-17 (March 17, 2001)</a></h2>
 <ul>
 <li>moved to using distutils setup.py (requires small patch to distutils
 that has been submitted against python 2.1b1)</li>
 </ul>
-<h2><a name="version-2000-11-14-november-14-2000">Version 2000-11-14 (November 14, 2000)</a></h2>
+<h2><a>Version 2000-11-14 (November 14, 2000)</a></h2>
 <ul>
 <li>GNU_RUNTIME is likely completely broken</li>
 <li>Compiles on Mac OS X Server (python 2.0)</li>
 <li>Some pre-OSX stuff removed;  references to old APIs, etc... (but
 nowhere near clean)</li>
 </ul>
-<h2><a name="version-0-55-18-august-1998">Version 0.55, 18 August 1998</a></h2>
+<h2><a>Version 0.55, 18 August 1998</a></h2>
 <ul>
 <li>Here again, supporting GNU_RUNTIME and GNUstep Base! On my new Linux
 box I can finally test the module against them: I installed the
 </pre>
 </li>
 </ul>
-<h2><a name="version-0-54-24-march-1998">Version 0.54, 24 March 1998</a></h2>
+<h2><a>Version 0.54, 24 March 1998</a></h2>
 <ul>
 <li>OC_Pasteboard.[hm], OC_Stream.[mh] and ObjCStreams.m are definitively gone.</li>
 <li>OC_PythonObject derives from NSProxy.</li>
 </ul>
-<h2><a name="version-0-53-4-january-1998">Version 0.53, 4 January 1998</a></h2>
+<h2><a>Version 0.53, 4 January 1998</a></h2>
 <ul>
 <li>Tons of changes, retargeting the core functionality around the
 OpenSTEP API. This release basically matches the previous one
 if they are needed anymore.</li>
 <li>Updated LittleButtonedWindow demo.</li>
 </ul>
-<h2><a name="version-0-47-29-october-1996">Version 0.47, 29 October 1996</a></h2>
+<h2><a>Version 0.47, 29 October 1996</a></h2>
 <ul>
 <li>Misc/Makefile.pre.in automatically sets TARGET to <code><span>pyobjc</span></code>.</li>
 <li>ObjC.m splitted to ObjCObject.m ObjCMethod.m ObjCPointer.m
 <li>OC_Streams are mapped to ObjCStreams by pythonify_c_value and its
 counterpart.</li>
 </ul>
-<h2><a name="version-0-46-18-october-1996">Version 0.46, 18 October 1996</a></h2>
+<h2><a>Version 0.46, 18 October 1996</a></h2>
 <ul>
 <li>OC_Stream is now a subclass of NSData under Foundation.</li>
 <li>New Objective-C class: OC_Pasteboard. Use it instead of Pasteboard/
 <li>OC_Python.[hm] aren't in the package anymore.</li>
 <li>Setup.in directives changed again, due to OC_Python.m dropping.</li>
 </ul>
-<h2><a name="version-0-45-14-october-1996">Version 0.45, 14 October 1996</a></h2>
+<h2><a>Version 0.45, 14 October 1996</a></h2>
 <ul>
 <li>Double syntax: to make it easier for us to test and choose the
 better candidate, the only one that will be present in the final 1.0
 release. Keeping both would result in a speed penality.</li>
 <li>Revisited streams, in particular GNUstep support.</li>
 </ul>
-<h2><a name="version-0-44-9-october-1996">Version 0.44, 9 October 1996</a></h2>
+<h2><a>Version 0.44, 9 October 1996</a></h2>
 <ul>
 <li>Integers are now accepted too where floats or doubles are expected.</li>
 <li>New method: ObjC.make_pointer (1) returns an ObjCPointer containing
 <code><span>((void</span> <span>*)</span> <span>1)</span></code>.</li>
 </ul>
-<h2><a name="version-0-43-7-october-1996">Version 0.43, 7 October 1996</a></h2>
+<h2><a>Version 0.43, 7 October 1996</a></h2>
 <ul>
 <li>Completed ObjCStream implementation. There is now a new module, ObjCStreams
 which is automatically loaded by ObjC. You can access it as ObjC.streams.</li>
 libObjC.tex describing the main module, libObjCStreams.tex explains the
 stream facilities.</li>
 </ul>
-<h2><a name="version-0-42-4-october-1996">Version 0.42, 4 October 1996</a></h2>
+<h2><a>Version 0.42, 4 October 1996</a></h2>
 <ul>
 <li>You can pass initialization arguments when using the <code><span>Class()</span></code> syntax. You
 select the right initializer selector with the <code><span>init</span></code> keyword parameter.</li>
 <li>First cut on ObjCStream objects. Thanx to Bill Bumgarner for motivations.</li>
 <li>New demo ShellText, to test above points.</li>
 </ul>
-<h2><a name="version-0-41-2-october-1996">Version 0.41, 2 October 1996</a></h2>
+<h2><a>Version 0.41, 2 October 1996</a></h2>
 <ul>
 <li>Revised error messages: for arguments type mismatch they show the ObjC type
 expected.</li>
 <li>Setup.in directives changed. See the new file Modules/Setup.PyObjC.in</li>
 <li>Distribuited as a standalone package. Special thanks to Bill Bumgarner.</li>
 </ul>
-<h2><a name="version-0-4-27-september-1996">Version 0.4, 27 September 1996</a></h2>
+<h2><a>Version 0.4, 27 September 1996</a></h2>
 <ul>
 <li>Now handles methods returning doubles or floats.</li>
 <li>ObjCRuntime responds to .sel_is_mapped().</li>
 </ul>
-<h2><a name="version-0-31-26-september-1996">Version 0.31, 26 September 1996</a></h2>
+<h2><a>Version 0.31, 26 September 1996</a></h2>
 <ul>
 <li>It's now possible to use a different strategy to map ObjC method names to
 Python ones. Sooner or later we should decide the one to go, and drop the
 <li>ObjC.runtime.__dict__ added.</li>
 <li>ObjC.runtime.kind added.</li>
 </ul>
-<h2><a name="version-0-3-20-september-1996">Version 0.3, 20 September 1996</a></h2>
+<h2><a>Version 0.3, 20 September 1996</a></h2>
 <ul>
 <li>No user visible changes, just a little effort towards GNU_RUNTIME support.</li>
 </ul>
-<h2><a name="version-0-2-16-september-1996">Version 0.2, 16 September 1996</a></h2>
+<h2><a>Version 0.2, 16 September 1996</a></h2>
 <ul>
 <li>Accepts a struct.pack() string for pointer arguments, but...</li>
 <li>... New methods on ObjCMethod: .pack_argument and .unpack_argument:
 </pre>
 </li>
 </ul>
-<h2><a name="version-0-1-13-september-1996">Version 0.1, 13 September 1996</a></h2>
+<h2><a>Version 0.1, 13 September 1996</a></h2>
 <ul>
 <li>Correctly handle pointer arguments.</li>
 <li>New syntax to get a class: ObjC.runtime.NameOfClass</li>
 
 An overview of the relevant changes in new, and older, releases.
 
+Version 1.3.7 (????-??-??)
+--------------------------
+
+- Fixed a problem with reference counting in initializers.
+
 Version 1.3.6 (2005-05-19)
 --------------------------
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.