SF.net SVN: jython:[7135] trunk/jython/src/org/python/modules/_threading/ _threading.java

[email protected] Tue, 05 Oct 2010 20:19:44 +0000
Newsgroups gmane.comp.lang.jython.cvs
Message-ID <[email protected]>
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.

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb