Commit 78c84b9
committed
Fix memory leak due to Images of Graph (PySimpleGui27)
- Graph used a list self.Images to which new images where appended on
DrawImage. Neither in DeleteFigure nor in Erase were any elements
removed from that list. Thus any added image was kept in memory as
long as the corresponding Graph was; even if it wasn't used
anymore.
- Even though self.Images is not referred to in any other way,
removing the list completely does not work; the result
is that no images are drawn on the Graph.
- The implemented solution uses a dictionary (id -> image) to keep
only used images in self.Images.1 parent bdaf950 commit 78c84b9
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2031 | 2031 | | |
2032 | 2032 | | |
2033 | 2033 | | |
2034 | | - | |
| 2034 | + | |
2035 | 2035 | | |
2036 | 2036 | | |
2037 | 2037 | | |
| |||
2186 | 2186 | | |
2187 | 2187 | | |
2188 | 2188 | | |
2189 | | - | |
2190 | 2189 | | |
2191 | 2190 | | |
| 2191 | + | |
2192 | 2192 | | |
2193 | 2193 | | |
2194 | 2194 | | |
| |||
2200 | 2200 | | |
2201 | 2201 | | |
2202 | 2202 | | |
| 2203 | + | |
2203 | 2204 | | |
2204 | 2205 | | |
2205 | 2206 | | |
| |||
2208 | 2209 | | |
2209 | 2210 | | |
2210 | 2211 | | |
| 2212 | + | |
2211 | 2213 | | |
2212 | 2214 | | |
2213 | 2215 | | |
| |||
0 commit comments