Commit 1f8826d
committed
JythonBindings: don't store engine or module
If the JythonScriptEngine or containing ScriptModule is set within the
PythonInterpreter, we will get a circular reference chain preventing
memory from the PythonInterpreter being reclaimed.
To avoid completely discarding these objects, we can keep them in a
shallow map to WeakReferences.1 parent 0444100 commit 1f8826d
File tree
1 file changed
+25
-5
lines changed- src/main/java/org/scijava/plugins/scripting/jython
1 file changed
+25
-5
lines changedLines changed: 25 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
| |||
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
84 | 94 | | |
85 | 95 | | |
86 | 96 | | |
| |||
91 | 101 | | |
92 | 102 | | |
93 | 103 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
98 | 115 | | |
| 116 | + | |
99 | 117 | | |
100 | 118 | | |
101 | 119 | | |
102 | 120 | | |
103 | 121 | | |
104 | 122 | | |
105 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
106 | 126 | | |
107 | 127 | | |
108 | 128 | | |
| |||
0 commit comments