From: <zy...@us...> - 2010-10-05 20:19:49
|
Revision: 7135 http://jython.svn.sourceforge.net/jython/?rev=7135&view=rev Author: zyasoft Date: 2010-10-05 20:19:43 +0000 (Tue, 05 Oct 2010) Log Message: ----------- Canonical map _jthread_to_pythread needs to have both weak keys AND weak values to avoid memory leaks. Fixes #1660, threading module memory leak Modified Paths: -------------- trunk/jython/src/org/python/modules/_threading/_threading.java Modified: trunk/jython/src/org/python/modules/_threading/_threading.java =================================================================== --- trunk/jython/src/org/python/modules/_threading/_threading.java 2010-10-04 19:52:55 UTC (rev 7134) +++ trunk/jython/src/org/python/modules/_threading/_threading.java 2010-10-05 20:19:43 UTC (rev 7135) @@ -20,7 +20,7 @@ // internals to support threading.py, test_threading.py public static Map<Long, PyObject> _threads = new MapMaker().weakValues().makeMap(); - public static Map<Thread, PyObject> _jthread_to_pythread = new MapMaker().weakKeys().makeMap(); + public static Map<Thread, PyObject> _jthread_to_pythread = new MapMaker().weakKeys().weakValues().makeMap(); public static Map<Long, PyObject> _active = _threads; public static void _register_thread(Thread jthread, PyObject pythread) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |