Properly decrement Python reference count in PyObjectID_hash. (#429)

This commit is contained in:
Robert Nishihara
2016-09-14 17:09:11 -07:00
committed by Philipp Moritz
parent feff561ca1
commit 8c6d3a88a9
+3 -1
View File
@@ -81,7 +81,9 @@ static long PyObjectID_hash(PyObject* a) {
PyObjectID* A = (PyObjectID*) a;
PyObject* tuple = PyTuple_New(1);
PyTuple_SetItem(tuple, 0, PyInt_FromLong(A->id));
return PyObject_Hash(tuple);
long hash = PyObject_Hash(tuple);
Py_XDECREF(tuple);
return hash;
}
char RAY_ID_LITERAL[] = "id";