Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Check the result of adding the pending call (for releasing XID).
  • Loading branch information
ericsnowcurrently committed Apr 5, 2019
commit f354a86647857b155fd4df83f2a54b2196a6b694
11 changes: 9 additions & 2 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ _PyCrossInterpreterData_Release(_PyCrossInterpreterData *data)
return;
}

// Switch to the original interpreter.
// Get the original interpreter.
PyInterpreterState *interp = _PyInterpreterState_LookUpID(data->interp);
if (interp == NULL) {
// The intepreter was already destroyed.
Expand All @@ -1381,9 +1381,16 @@ _PyCrossInterpreterData_Release(_PyCrossInterpreterData *data)
}
return;
}
// XXX There's a slight race here...
if (interp->finalizing) {
// XXX Someone leaked some memory...
return;
}

// "Release" the data and/or the object.
_Py_AddPendingCall(interp, 0, _release_xidata, data);
if (_Py_AddPendingCall(interp, 0, _release_xidata, data) != 0) {
// XXX Queue full or couldn't get lock. Try again somehow?
}
}

PyObject *
Expand Down