Commits

Ronald Oussoren  committed 7407dfc

fix reference counting

  • Participants
  • Parent commits 0ae37e2
  • Branches pyobjc-ancient

Comments (0)

Files changed (1)

File Modules/objc/super-call.m

 
 			if (!special_class) {
 				special_class = pyclass;
-				result = PyTuple_GetItem(entry, 2);
+				Py_INCREF(special_class);
+				result = PyTuple_GET_ITEM(entry, 2);
 
 			} else if (pyclass == Py_None) {
+				Py_DECREF(special_class);
 				special_class = pyclass;
-				result = PyTuple_GetItem(entry, 2);
+				Py_INCREF(special_class);
+				result = PyTuple_GET_ITEM(entry, 2);
 
 			} else if (PyType_IsSubtype(
 					(PyTypeObject*)special_class,
 					(PyTypeObject*)pyclass
 				    )) {
+				Py_DECREF(special_class);
 				special_class = pyclass;
-				result = PyTuple_GetItem(entry, 2);
+				Py_INCREF(special_class);
+				result = PyTuple_GET_ITEM(entry, 2);
 			}
 		}
 	}