Skip to content

Commit 7a769e4

Browse files
committed
chore: update version to 0.16.2 and enhance changelog with bug fixes and performance improvements
1 parent 772d1bf commit 7a769e4

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# PythonQwt Releases
22

3+
## Version 0.16.2
4+
5+
### Bug fixes
6+
7+
- Fixed a `QFont`/GDI handle leak that release 0.16.1 only masked: the font-key cache retained a strong reference to every distinct `QFont` it had seen (up to 1024 entries), each pinning its underlying font engine and, on Windows GDI builds, an `HFONT` handle, accumulating towards the per-process GDI limit. The cache is now a single-slot, leak-free memo and the remaining metrics caches use proper LRU eviction instead of a clear-on-overflow that periodically rebuilt `QFontMetrics` results
8+
- Fixed delayed release of native GDI handles caused by Python reference cycles: `QwtPlotItem` and `QwtPlotCanvas` held strong back-references to their parent `QwtPlot`, so plots were only reclaimed by the cyclic garbage collector. These back-references are now weak, matching the C++ Qwt parent/child model, so a plot is freed by reference counting alone and could otherwise exhaust the ~10000 GDI-object limit on Windows under heavy create/destroy churn
9+
- Fixed noisy "Unhandled exception" `AttributeError` tracebacks at teardown on Python 3.14 / Qt 6: during widget destruction Qt still delivers events and calls size-hint methods on `QwtPlot` objects whose Python `__dict__` has already been cleared. Access to private instance data in `QwtPlot.eventFilter` and `QwtPlot.minimumSizeHint` is now guarded
10+
11+
### Performance
12+
13+
- Restored most of the text-layout performance lost to the GDI-leak fix by reinstating a bounded, leak-free `id(font)` fast path in `QwtText.textSize` (the layout cache holds a strong reference to its single cached font, so the font id cannot be reused)
14+
15+
### Other changes
16+
17+
- Added GDI-handle and font-cache telemetry/benchmark scripts under `scripts/` (`bench_gdi_loadtest.py`, `telemetry_fontcache.py`) and a pytest stress test (`qwt/tests/test_issue107_gdi_leak.py`) to detect resource leaks under repeated plot create/render/destroy cycles
18+
19+
320
## Version 0.16.1
421

522
### Bug fixes

qwt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
from qwt.text import QwtText # noqa: F401
6464
from qwt.toqimage import array_to_qimage as toQImage # noqa: F401
6565

66-
__version__ = "0.16.1"
66+
__version__ = "0.16.2"
6767
QWT_VERSION_STR = "6.1.5"
6868

6969

0 commit comments

Comments
 (0)