Handle more memory allocation failures without crashing.

This commit is contained in:
Neal Norwitz 2006-07-21 07:59:47 +00:00
parent 33722aec57
commit d12bd012a6
5 changed files with 38 additions and 8 deletions

View file

@ -267,6 +267,8 @@ find_key(int key, void *value)
struct key *p;
long id = PyThread_get_thread_ident();
if (!keymutex)
return NULL;
PyThread_acquire_lock(keymutex, 1);
for (p = keyhead; p != NULL; p = p->next) {
if (p->id == id && p->key == key)