Commit bfc5b5c
committed
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 2d59af7 commit bfc5b5c
3 files changed
+13
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
422 | | - | |
423 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
424 | 425 | | |
425 | 426 | | |
426 | 427 | | |
| |||
| 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