Commit 9280d50
committed
fix: break plot<->item/canvas reference cycles to free GDI by refcount
QwtPlotItem and QwtPlotCanvas held a strong back-reference to their parent
QwtPlot, forming Python reference cycles that only the cyclic garbage
collector could reclaim. This delayed the release of native GDI handles and
could exhaust the ~10000 GDI-object limit on Windows under heavy plot
create/destroy churn. Make these back-references weak so a plot is freed by
reference counting alone, like the C++ Qwt parent/child model.1 parent 64a9401 commit 9280d50
2 files changed
Lines changed: 39 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
1815 | 1816 | | |
1816 | 1817 | | |
1817 | 1818 | | |
1818 | | - | |
| 1819 | + | |
1819 | 1820 | | |
1820 | 1821 | | |
1821 | | - | |
1822 | | - | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
1823 | 1825 | | |
1824 | | - | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
1825 | 1833 | | |
1826 | | - | |
1827 | | - | |
| 1834 | + | |
| 1835 | + | |
1828 | 1836 | | |
1829 | 1837 | | |
1830 | 1838 | | |
| |||
1854 | 1862 | | |
1855 | 1863 | | |
1856 | 1864 | | |
1857 | | - | |
| 1865 | + | |
| 1866 | + | |
1858 | 1867 | | |
1859 | 1868 | | |
1860 | 1869 | | |
| |||
1881 | 1890 | | |
1882 | 1891 | | |
1883 | 1892 | | |
1884 | | - | |
1885 | | - | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
1886 | 1896 | | |
1887 | | - | |
1888 | | - | |
| 1897 | + | |
| 1898 | + | |
1889 | 1899 | | |
1890 | 1900 | | |
1891 | 1901 | | |
| |||
2091 | 2101 | | |
2092 | 2102 | | |
2093 | 2103 | | |
2094 | | - | |
2095 | | - | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
2096 | 2107 | | |
2097 | 2108 | | |
2098 | 2109 | | |
| |||
2102 | 2113 | | |
2103 | 2114 | | |
2104 | 2115 | | |
2105 | | - | |
2106 | | - | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
2107 | 2119 | | |
2108 | 2120 | | |
2109 | 2121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
445 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
446 | 452 | | |
447 | 453 | | |
448 | 454 | | |
| |||
456 | 462 | | |
457 | 463 | | |
458 | 464 | | |
459 | | - | |
| 465 | + | |
| 466 | + | |
460 | 467 | | |
461 | 468 | | |
462 | 469 | | |
| |||
695 | 702 | | |
696 | 703 | | |
697 | 704 | | |
698 | | - | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
699 | 708 | | |
700 | 709 | | |
701 | 710 | | |
| |||
0 commit comments