Commit 331ad3b
fix(cleanup): clear global enum-wrapper registry before tearing down class infos
ASan reported a heap-use-after-free during teardown: the global registry
of top-level enum wrappers held raw pointers to `PythonQtClassInfo` that
were deleted in `~PythonQtPrivate()`. Subsequent lookups (e.g., triggered
by late attribute access) read freed memory.
- Add `PythonQtClassInfo::clearGlobalNamespaceWrappers()`
- Call it in `~PythonQtPrivate()` before `qDeleteAll(_knownClassInfos)`
- Explicitly clear `_knownClassInfos` after deletion to avoid stale entries1 parent fa3f76a commit 331ad3b
3 files changed
+13
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | | - | |
425 | | - | |
426 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
427 | 428 | | |
428 | 429 | | |
429 | 430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1043 | 1043 | | |
1044 | 1044 | | |
1045 | 1045 | | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
1046 | 1051 | | |
1047 | 1052 | | |
1048 | 1053 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
247 | 251 | | |
248 | 252 | | |
249 | 253 | | |
| |||
0 commit comments