Windows crash in long-running test sessions due to GDI handle exhaustion (suspected object lifetime/cache issue)
Describe the bug
On Windows, PythonQwt may crash with an access violation during long-running test sessions.
The failure appears after extended execution (on a large test run on Windows), which is consistent with Windows GDI handle exhaustion. Windows limits GDI handles to roughly 10,000 per process, and the process seems to exceed that limit over time.
Current analysis suggests the issue is linked to object lifecycle and cache management in PythonQwt, especially for internal private data objects backed by Qt/C++ resources.
Regression might be introduced after optimization : #93
To Reproduce
- Run a large PythonQwt-dependent test suite on Windows in a single process with large data creation
- Monitor process GDI handle count over time (for example with Task Manager or Process Explorer).
- Continue until late-stage execution.
- Observe continuous handle growth and eventual crash/access violation near the GDI limit.
Ideas
- Reintroduce QObject inheritance for the three affected PrivateData classes to ensure proper destruction and Qt-managed lifetime behavior.
- Remove slots in these classes (suspected to interact poorly with asynchronous deallocation/lifetime expectations).
- Add a defensive cache size limit.
Windows crash in long-running test sessions due to GDI handle exhaustion (suspected object lifetime/cache issue)
Describe the bug
On Windows, PythonQwt may crash with an access violation during long-running test sessions.
The failure appears after extended execution (on a large test run on Windows), which is consistent with Windows GDI handle exhaustion. Windows limits GDI handles to roughly 10,000 per process, and the process seems to exceed that limit over time.
Current analysis suggests the issue is linked to object lifecycle and cache management in PythonQwt, especially for internal private data objects backed by Qt/C++ resources.
Regression might be introduced after optimization : #93
To Reproduce
Ideas