Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv11387/python/Python Modified Files: thread_nt.h Log Message: SF patch 522961: Leak in Python/thread_nt.h, from Gerald S. Williams. A file-static "threads" dict mapped thread IDs to Windows handles, but was never referenced, and entries never got removed. This gets rid of the YAGNI-dict entirely. Bugfix candidate. Index: thread_nt.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_nt.h,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -d -r2.21 -r2.22 *** thread_nt.h 19 Jan 2002 22:02:55 -0000 2.21 --- thread_nt.h 28 Feb 2002 21:34:34 -0000 2.22 *************** *** 2,10 **** /* This code implemented by Dag.Gruneau@elsa.preseco.comm.se */ /* Fast NonRecursiveMutex support by Yakov Markovitch, markovitch@iso.ru */ #include <windows.h> #include <limits.h> #include <process.h> - #include <Python.h> typedef struct NRMUTEX { --- 2,10 ---- /* This code implemented by Dag.Gruneau@elsa.preseco.comm.se */ /* Fast NonRecursiveMutex support by Yakov Markovitch, markovitch@iso.ru */ + /* Eliminated some memory leaks, gsw@agere.com */ #include <windows.h> #include <limits.h> #include <process.h> typedef struct NRMUTEX { *************** *** 14,20 **** } NRMUTEX, *PNRMUTEX ; - /* dictionary to correlate thread ids with the handle needed to terminate them*/ - static PyObject *threads = NULL; - typedef PVOID WINAPI interlocked_cmp_xchg_t(PVOID *dest, PVOID exc, PVOID comperand) ; --- 14,17 ---- *************** *** 140,153 **** /* - * Change all headers to pure ANSI as no one will use K&R style on an - * NT - */ - - /* * Initialization of the C package, should not be needed. */ static void PyThread__init_thread(void) { - threads = PyDict_New(); } --- 137,144 ---- *************** *** 183,187 **** callobj *obj; int id; - PyObject *key, *val; dprintf(("%ld: PyThread_start_new_thread called\n", PyThread_get_thread_ident())); --- 174,177 ---- *************** *** 204,210 **** WaitForSingleObject(obj->done, 5000); /* maybe INFINITE instead of 5000? */ CloseHandle((HANDLE)obj->done); - key = PyLong_FromLong(obj->id); - val = PyLong_FromLong((long)rv); - PyDict_SetItem(threads, key, val); id = obj->id; free(obj); --- 194,197 ----
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4